changeset 0ec525152985 in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=0ec525152985 description: prevent traceback in trigger plugin.
diffstat:
plugins/triggers/manifest.ini | 2 +- plugins/triggers/triggers.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-)
diffs (28 lines):
diff -r e873dbfdbcc5 -r 0ec525152985 plugins/triggers/manifest.ini --- a/plugins/triggers/manifest.ini Tue Nov 08 20:01:51 2011 +0100 +++ b/plugins/triggers/manifest.ini Tue Nov 08 20:23:48 2011 +0100 @@ -1,7 +1,7 @@ [info] name: Triggers short_name: triggers -version: 0.0.2 +version: 0.0.3 description: Configure Gajim's behaviour for each contact authors: Yann Leboulanger asterix@lagaule.org homepage: http://trac.gajim.org/wiki/ diff -r e873dbfdbcc5 -r 0ec525152985 plugins/triggers/triggers.py --- a/plugins/triggers/triggers.py Tue Nov 08 20:01:51 2011 +0100 +++ b/plugins/triggers/triggers.py Tue Nov 08 20:23:48 2011 +0100 @@ -48,8 +48,10 @@ if rule['recipient_type'] == 'contact' and obj.jid not in \ rule_recipients: return False - contact_groups = gajim.contacts.get_first_contact_from_jid( - obj.conn.name, obj.jid).groups + contact = gajim.contacts.get_first_contact_from_jid(obj.conn.name, obj.jid) + if not contact: # PM? + return False + contact_groups = contact.groups group_found = False for group in contact_groups: if group in rule_recipients: