summaryrefslogtreecommitdiff
path: root/sleekxmpp/features/feature_mechanisms/stanza/challenge.py
diff options
context:
space:
mode:
Diffstat (limited to 'sleekxmpp/features/feature_mechanisms/stanza/challenge.py')
-rw-r--r--sleekxmpp/features/feature_mechanisms/stanza/challenge.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/sleekxmpp/features/feature_mechanisms/stanza/challenge.py b/sleekxmpp/features/feature_mechanisms/stanza/challenge.py
index 82af869f..342463e1 100644
--- a/sleekxmpp/features/feature_mechanisms/stanza/challenge.py
+++ b/sleekxmpp/features/feature_mechanisms/stanza/challenge.py
@@ -33,7 +33,10 @@ class Challenge(StanzaBase):
return base64.b64decode(bytes(self.xml.text))
def set_value(self, values):
- self.xml.text = bytes(base64.b64encode(values)).decode('utf-8')
+ if values:
+ self.xml.text = bytes(base64.b64encode(values)).decode('utf-8')
+ else:
+ self.xml.text = '='
def del_value(self):
self.xml.text = ''