diff --git a/js/ui.js b/js/ui.js index d2e1261..5ffe494 100644 --- a/js/ui.js +++ b/js/ui.js @@ -154,7 +154,7 @@ export const ui = { if (!msg.fromMe && (!activeChatState || activeChatState.id !== (msg.fromMe ? msg.to : msg.from))) { const unreadBadge = chat.querySelector('.unread-badge'); - unreadBadge.innerText = (Number(unreadBadge.innerHTML) || 0) + 1; + if (unreadBadge) unreadBadge.innerText = (Number(unreadBadge.innerHTML) || 0) + 1; } } },