Skip to content

Commit

Permalink
Fix: isBlocked throws on invalid HTML element (#1032)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbseel authored Jan 10, 2023
1 parent d08913d commit 66abe17
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/rrweb/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ export function isBlocked(
if (classMatchesRegex(el, blockClass, checkAncestors)) return true;
}
if (blockSelector) {
if ((node as HTMLElement).matches(blockSelector)) return true;
if (el.matches(blockSelector)) return true;
if (checkAncestors && el.closest(blockSelector) !== null) return true;
}
return false;
Expand Down

0 comments on commit 66abe17

Please sign in to comment.