Explorar el Código

Bugfix. Check if chatbox exists

JC Brand hace 7 años
padre
commit
ea60f190aa
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. 3 1
      src/converse-chatboxes.js

+ 3 - 1
src/converse-chatboxes.js

@@ -791,7 +791,9 @@
                      * chatbox open for it, and if so attach it to the chatbox.
                      */
                     const chatbox = _converse.chatboxes.findWhere({'jid': contact.get('jid')});
-                    chatbox.addRelatedContact(contact);
+                    if (chatbox) {
+                        chatbox.addRelatedContact(contact);
+                    }
                 });
             });