Skip to content

Commit

Permalink
fix: more robust rootShadowHost check (#50)
Browse files Browse the repository at this point in the history
This _may_ be the underlying cause
[here](https://sentry.sentry.io/issues/3725692470/?project=11276&referrer=assigned_activity-email),
maybe an e.g. `undefined` sneaked in there somehow. IMHO this should
also safe some bytes.
  • Loading branch information
mydea authored Feb 20, 2023
1 parent 5b4631b commit 4d900be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/rrweb/src/record/mutation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ export default class MutationBuffer {
// ensure shadowHost is a Node, or doc.contains will throw an error
const notInDoc =
!this.doc.contains(n) &&
(rootShadowHost === null || !this.doc.contains(rootShadowHost));
(!rootShadowHost || !this.doc.contains(rootShadowHost));
if (!n.parentNode || notInDoc) {
return;
}
Expand Down

0 comments on commit 4d900be

Please sign in to comment.