Skip to content

Commit 0de72c5

Browse files
committed
Check window first
1 parent 648d592 commit 0de72c5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/initializers/hashchange.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ function hashchange() {
2727
}
2828

2929
export function initialize() {
30-
if (typeof window.addEventListener === 'undefined') {
31-
return; // Fastboot
30+
if (typeof window === 'undefined' || typeof window.addEventListener === 'undefined') {
31+
// Don't run this initializer under FastBoot
32+
return;
3233
}
3334
window.addEventListener('hashchange', hashchange);
3435

0 commit comments

Comments
 (0)