Skip to content

Commit e92d104

Browse files
authored
fix: Guard access to window in helpers.dom.ts for browserless rendering (#11588)
1 parent 2a03e13 commit e92d104

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/helpers/helpers.dom.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,10 @@ export const supportsEventListenerOptions = (function() {
262262
}
263263
} as EventListenerOptions;
264264

265-
window.addEventListener('test', null, options);
266-
window.removeEventListener('test', null, options);
265+
if (_isDomSupported()) {
266+
window.addEventListener('test', null, options);
267+
window.removeEventListener('test', null, options);
268+
}
267269
} catch (e) {
268270
// continue regardless of error
269271
}

0 commit comments

Comments
 (0)