Skip to content

Commit

Permalink
fix: Guard access to window in helpers.dom.ts for browserless renderi…
Browse files Browse the repository at this point in the history
…ng (#11588)
  • Loading branch information
unverbraucht authored Nov 17, 2023
1 parent 2a03e13 commit e92d104
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/helpers/helpers.dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,10 @@ export const supportsEventListenerOptions = (function() {
}
} as EventListenerOptions;

window.addEventListener('test', null, options);
window.removeEventListener('test', null, options);
if (_isDomSupported()) {
window.addEventListener('test', null, options);
window.removeEventListener('test', null, options);
}
} catch (e) {
// continue regardless of error
}
Expand Down

0 comments on commit e92d104

Please sign in to comment.