summaryrefslogtreecommitdiff
path: root/sleekxmpp/stanza
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2011-07-02 22:50:31 -0700
committerLance Stout <lancestout@gmail.com>2011-07-02 22:50:31 -0700
commit540d7496954c38e5483205410662120ec9ccd8c8 (patch)
tree67a2dc52c2c38e14cb422018ac13243e7f58462d /sleekxmpp/stanza
parent219df582dab2a5dd3c9e2bbfef27d3cfa814841d (diff)
downloadslixmpp-540d7496954c38e5483205410662120ec9ccd8c8.tar.gz
slixmpp-540d7496954c38e5483205410662120ec9ccd8c8.tar.bz2
slixmpp-540d7496954c38e5483205410662120ec9ccd8c8.tar.xz
slixmpp-540d7496954c38e5483205410662120ec9ccd8c8.zip
Fix ordering bug when retrieving an error condition.
Diffstat (limited to 'sleekxmpp/stanza')
-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):