diff --git a/src/structures/Chat.js b/src/structures/Chat.js index 26363a8..6f0f0e2 100644 --- a/src/structures/Chat.js +++ b/src/structures/Chat.js @@ -184,7 +184,7 @@ class Chat extends Base { if (searchOptions && searchOptions.limit > 0) { while (msgs.length < searchOptions.limit) { const loadedMessages = await window.Store.ConversationMsgs.loadEarlierMsgs(chat); - if (!loadedMessages) break; + if (!loadedMessages || !loadedMessages.length) break; msgs = [...loadedMessages.filter(msgFilter), ...msgs]; }