mirror of
https://github.com/chartjs/Chart.js.git
synced 2026-03-12 03:06:54 +01:00
fix: Guard access to window in helpers.dom.ts for browserless rendering (#11588)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user