From c8d1eaa2dce1cabb33eae59b37b5a8ab024c034c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Wed, 8 Jul 2020 10:21:16 +0200 Subject: [PATCH] xep_0045: also return default value when attr doesn't exist MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- slixmpp/plugins/xep_0045/stanza.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slixmpp/plugins/xep_0045/stanza.py b/slixmpp/plugins/xep_0045/stanza.py index 2e1a1f8e..c3ae82bb 100644 --- a/slixmpp/plugins/xep_0045/stanza.py +++ b/slixmpp/plugins/xep_0045/stanza.py @@ -29,7 +29,7 @@ class MUCBase(ElementBase): item = self.xml.find(f'{{{NS_USER}}}item') if item is None: return default - return item.get(attr) + return item.get(attr, default) def set_item_attr(self, attr, value: str): item = self.xml.find(f'{{{NS_USER}}}item')