Even safer check

This commit is contained in:
sto
2025-11-09 11:10:46 +01:00
parent 4592412ab6
commit 2b72c7a98d

View File

@@ -52,7 +52,7 @@ function checkNewMessages() {
const el = messageNode.firstChild.firstChild.firstChild.firstChild; const el = messageNode.firstChild.firstChild.firstChild.firstChild;
if (seenMessages.has(el)) continue; if (seenMessages.has(el)) continue;
const rootNode = messageNode.parentNode.parentNode; const rootNode = messageNode.parentNode.parentNode;
if (!rootNode.firstChild.firstChild) continue; if (!rootNode?.firstChild?.firstChild) continue;
const name = rootNode.firstChild.firstChild.innerHTML; const name = rootNode.firstChild.firstChild.innerHTML;
newElements = true; newElements = true;
seenMessages.add(el); seenMessages.add(el);