Skip to content

Commit 888f667

Browse files
Be more resilient when applying chat highlights.
1 parent 39ee42b commit 888f667

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

extension/changelog.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"message": "Correctly detect the background page on Firefox. This should fix multiple features, including the event badge.",
1616
"contributor": "DeKleineKobini"
1717
},
18-
{ "message": "Avoid blocking FF scouter gauges on unconfigured pages.", "contributor": "DeKleineKobini" }
18+
{ "message": "Avoid blocking FF scouter gauges on unconfigured pages.", "contributor": "DeKleineKobini" },
19+
{ "message": "Be more resilient when applying chat highlights.", "contributor": "DeKleineKobini" }
1920
],
2021
"changes": [
2122
{ "message": "Disable OC1 timer when detecting OC 2 data.", "contributor": "DeKleineKobini" },

extension/scripts/features/chat-highlight/ttChatHighlight.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858

5959
function applyHighlights(message) {
6060
if (!message) return;
61-
if (!highlights.length) return;
61+
if (!highlights?.length) return;
6262

6363
const sender = simplify(message.find("[class*='chat-box-message__sender__']").textContent.replace(":", ""));
6464
const words = message.lastElementChild.textContent.split(" ").map(simplify);

0 commit comments

Comments
 (0)