Skip to content

Commit

Permalink
fix: Guard access to window in helpers.dom.ts for browserless rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
unverbraucht committed Sep 26, 2023
1 parent 6516b0a commit c7046d5
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 c7046d5

Please sign in to comment.