summaryrefslogtreecommitdiff
path: root/sleekxmpp/stanza/error.py
diff options
context:
space:
mode:
Diffstat (limited to 'sleekxmpp/stanza/error.py')
-rw-r--r--sleekxmpp/stanza/error.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/sleekxmpp/stanza/error.py b/sleekxmpp/stanza/error.py
index 5d1ce50d..93231a48 100644
--- a/sleekxmpp/stanza/error.py
+++ b/sleekxmpp/stanza/error.py
@@ -88,7 +88,9 @@ class Error(ElementBase):
"""Return the condition element's name."""
for child in self.xml.getchildren():
if "{%s}" % self.condition_ns in child.tag:
- return child.tag.split('}', 1)[-1]
+ cond = child.tag.split('}', 1)[-1]
+ if cond in self.conditions:
+ return cond
return ''
def set_condition(self, value):