diff --git a/code/chat.js b/code/chat.js index 00c0e5a9..dc01f3f2 100644 --- a/code/chat.js +++ b/code/chat.js @@ -389,6 +389,7 @@ window.chat.needMoreMessages = function() { if(activeTab === 'debug') return; var activeChat = $('#chat > :visible'); + if(activeChat.length === 0) return; var hasScrollbar = scrollBottom(activeChat) !== 0 || activeChat.scrollTop() !== 0; var nearTop = activeChat.scrollTop() <= CHAT_REQUEST_SCROLL_TOP;