浏览代码

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) {
                     if (this.model.get('connection_status') !==  converse.ROOMSTATUS.ENTERED) {
                         const handler = () => {
                         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.join();
                             this.fetchMessages();
                             this.fetchMessages();
                             _converse.emit('chatRoomOpened', this);
                             _converse.emit('chatRoomOpened', this);