Commit a4c4d6d2 authored by JC Brand's avatar JC Brand

Don't break when roster is not defined

parent 7b4fe902
...@@ -115,6 +115,10 @@ ...@@ -115,6 +115,10 @@
/* Shows an HTML5 Notification to indicate that a new chat /* Shows an HTML5 Notification to indicate that a new chat
* message was received. * message was received.
*/ */
if (typeof converse.roster === 'undefined') {
converse.log("Could not send notification, because roster is undefined", "error");
return;
}
var contact_jid = Strophe.getBareJidFromJid($message.attr('from')); var contact_jid = Strophe.getBareJidFromJid($message.attr('from'));
var roster_item = converse.roster.get(contact_jid); var roster_item = converse.roster.get(contact_jid);
var n = new Notification(__(___("%1$s says"), roster_item.get('fullname')), { var n = new Notification(__(___("%1$s says"), roster_item.get('fullname')), {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment