Skip to content

Commit

Permalink
fix(rrweb): Fix rule.style being undefined (#121)
Browse files Browse the repository at this point in the history
Fixes JAVASCRIPT-2MPK
Closes getsentry/team-replay#216
  • Loading branch information
billyvg authored Oct 25, 2023
1 parent 66d7f91 commit b8c77f4
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions packages/rrweb/src/replay/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1960,19 +1960,20 @@ export class Replayer {
styleSheet.rules,
data.index,
) as unknown as CSSStyleRule;
rule.style.setProperty(
data.set.property,
data.set.value,
data.set.priority,
);
rule.style &&
rule.style.setProperty(
data.set.property,
data.set.value,
data.set.priority,
);
}

if (data.remove) {
const rule = getNestedRule(
styleSheet.rules,
data.index,
) as unknown as CSSStyleRule;
rule.style.removeProperty(data.remove.property);
rule.style && rule.style.removeProperty(data.remove.property);
}
}

Expand Down

0 comments on commit b8c77f4

Please sign in to comment.