소스 검색

Bail when in a callback for a hanging chatroom

JC Brand 7 년 전
부모
커밋
4f7c08b1da
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 6 0
      src/converse-muc-views.js

+ 6 - 0
src/converse-muc-views.js

@@ -531,6 +531,12 @@
 
                     if (this.model.get('connection_status') !==  converse.ROOMSTATUS.ENTERED) {
                         const handler = () => {
+                            if (!u.isPersistableModel(this.model)) {
+                                // Happens during tests, nothing to do if this
+                                // is a hanging chatbox (i.e. not in the
+                                // collection anymore).
+                                return;
+                            }
                             this.join();
                             this.fetchMessages();
                             _converse.emit('chatRoomOpened', this);