소스 검색

Bugfix. Check if chatbox exists

JC Brand 7 년 전
부모
커밋
ea60f190aa
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  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);
+                    }
                 });
             });