Skip to content

Commit

Permalink
fix: Fix checking for patchTarget in initAdoptedStyleSheetObserver
Browse files Browse the repository at this point in the history
  • Loading branch information
mydea committed Oct 12, 2023
1 parent 36250d9 commit a523849
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/rrweb/src/record/observer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -957,10 +957,10 @@ export function initAdoptedStyleSheetObserver(
host.nodeName === '#document'
? (host as Document).defaultView?.Document
: host.ownerDocument?.defaultView?.ShadowRoot;
const originalPropertyDescriptor = Object.getOwnPropertyDescriptor(
const originalPropertyDescriptor = patchTarget?.prototype ? Object.getOwnPropertyDescriptor(
patchTarget?.prototype,
'adoptedStyleSheets',
);
) : undefined;
if (
hostId === null ||
hostId === -1 ||
Expand Down

0 comments on commit a523849

Please sign in to comment.