Skip to content

Commit 1ee88fe

Browse files
authored
Merge pull request #43 from pendo-io/mb-fix-error-thrown-stringify-rule
prevent error thrown when rule.stylesheet is undefined
2 parents aae3063 + 9e3ace8 commit 1ee88fe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/rrweb-snapshot/src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ export function stringifyRule(rule: CSSRule, sheetHref: string | null): string {
170170
} catch (error) {
171171
importStringified = rule.cssText;
172172
}
173-
if (rule.styleSheet.href) {
173+
if (rule?.styleSheet?.href) {
174174
// url()s within the imported stylesheet are relative to _that_ sheet's href
175175
return absolutifyURLs(importStringified, rule.styleSheet.href);
176176
}

0 commit comments

Comments
 (0)