summaryrefslogtreecommitdiff
path: root/sleekxmpp/stanza
diff options
context:
space:
mode:
Diffstat (limited to 'sleekxmpp/stanza')
-rw-r--r--sleekxmpp/stanza/iq.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/sleekxmpp/stanza/iq.py b/sleekxmpp/stanza/iq.py
index cec0f8bc..e3eccfdc 100644
--- a/sleekxmpp/stanza/iq.py
+++ b/sleekxmpp/stanza/iq.py
@@ -48,14 +48,14 @@ class Iq(RootStanza):
def setQuery(self, value):
query = self.xml.find("{%s}query" % value)
- if query is None:
+ if query is None and value:
self.clear()
query = ET.Element("{%s}query" % value)
self.xml.append(query)
return self
def getQuery(self):
- for child in self.getchildren():
+ for child in self.xml.getchildren():
if child.tag.endswith('query'):
ns =child.tag.split('}')[0]
if '{' in ns: