2
0
Эх сурвалжийг харах

Don't break when roster is not defined

JC Brand 9 жил өмнө
parent
commit
a4c4d6d2d3

+ 4 - 0
src/converse-notification.js

@@ -115,6 +115,10 @@
                 /* Shows an HTML5 Notification to indicate that a new chat
                  * 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 roster_item = converse.roster.get(contact_jid);
                 var n = new Notification(__(___("%1$s says"), roster_item.get('fullname')), {