xep_0054: raise item-not-found instead of trying to call None.send()

This commit is contained in:
nicoco 2023-02-23 23:37:31 +01:00
parent 1f934d375c
commit de358464d0

View File

@ -134,8 +134,10 @@ class XEP_0054(BasePlugin):
return
elif iq['type'] == 'get' and self.xmpp.is_component:
vcard = await self.api['get_vcard'](iq['to'].bare, ifrom=iq['from'])
if isinstance(vcard, Iq):
vcard.send()
if vcard is None:
raise XMPPError("item-not-found")
elif isinstance(vcard, Iq):
await vcard.send()
else:
iq = iq.reply()
iq.append(vcard)