summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2015-05-26 14:28:34 +0200
committerFlorent Le Coz <louiz@louiz.org>2015-05-26 14:38:22 +0200
commit0c8fe4da306724aa3757989836ce94fea4d8206f (patch)
treea15b816c52a6b6211ac08bd572735a959f110c77
parent03c2d2974a613e42cd1634fcea7d5eede282cded (diff)
downloadpoezio-0c8fe4da306724aa3757989836ce94fea4d8206f.tar.gz
poezio-0c8fe4da306724aa3757989836ce94fea4d8206f.tar.bz2
poezio-0c8fe4da306724aa3757989836ce94fea4d8206f.tar.xz
poezio-0c8fe4da306724aa3757989836ce94fea4d8206f.zip
Properly yield an error on /add without arguments
-rw-r--r--src/tabs/rostertab.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/tabs/rostertab.py b/src/tabs/rostertab.py
index aaff7de3..bd63d0e3 100644
--- a/src/tabs/rostertab.py
+++ b/src/tabs/rostertab.py
@@ -619,10 +619,13 @@ class RosterInfoTab(Tab):
Add the specified JID to the roster, and set automatically
accept the reverse subscription
"""
- jid = safeJID(safeJID(args[0]).bare)
- if not jid:
+ if args is None:
self.core.information('No JID specified', 'Error')
return
+ jid = safeJID(safeJID(args[0]).bare)
+ if not str(jid):
+ self.core.information('The provided JID (%s) is not valid' % (args[0],), 'Error')
+ return
if jid in roster and roster[jid].subscription in ('to', 'both'):
return self.core.information('Already subscribed.', 'Roster')
roster.add(jid)