diff --git a/plugins/triggers/manifest.ini b/plugins/triggers/manifest.ini index a31225bb5..173bd102d 100644 --- a/plugins/triggers/manifest.ini +++ b/plugins/triggers/manifest.ini @@ -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 homepage: http://trac.gajim.org/wiki/ diff --git a/plugins/triggers/triggers.py b/plugins/triggers/triggers.py index 813ae6ea5..1cfdd9769 100644 --- a/plugins/triggers/triggers.py +++ b/plugins/triggers/triggers.py @@ -48,8 +48,10 @@ class Triggers(GajimPlugin): 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: