From 0c8fe4da306724aa3757989836ce94fea4d8206f Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Tue, 26 May 2015 14:28:34 +0200 Subject: Properly yield an error on /add without arguments --- src/tabs/rostertab.py | 7 +++++-- 1 file 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) -- cgit v1.2.3