From de358464d0e9451ae4dadd9b2d680b61d384f5b6 Mon Sep 17 00:00:00 2001 From: nicoco Date: Thu, 23 Feb 2023 23:37:31 +0100 Subject: [PATCH] xep_0054: raise item-not-found instead of trying to call None.send() --- slixmpp/plugins/xep_0054/vcard_temp.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/slixmpp/plugins/xep_0054/vcard_temp.py b/slixmpp/plugins/xep_0054/vcard_temp.py index c909f6cd..e3292b21 100644 --- a/slixmpp/plugins/xep_0054/vcard_temp.py +++ b/slixmpp/plugins/xep_0054/vcard_temp.py @@ -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)