Skip to content

Commit

Permalink
wrap parseRegex in break
Browse files Browse the repository at this point in the history
  • Loading branch information
KentoNishi committed Jun 3, 2024
1 parent 0445055 commit 5412b97
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/ts/ytcf-logic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,14 @@ export function shouldFilterMessage(action: Chat.MessageAction): boolean {
if (!condition.value) {
numValidFilters--;
} else {
const regex = parseRegex(condition.value);
const result = regex.test(compStr);
if (result === condition.invert) {
try {
const regex = parseRegex(condition.value);
const result = regex.test(compStr);
if (result === condition.invert) {
break;
}
} catch (e) {
console.error(e);
break;
}
}
Expand Down

0 comments on commit 5412b97

Please sign in to comment.