Skip to content

Commit 39cf725

Browse files
committed
Check if body exists. Fix phaserjs#3649.
1 parent 4106f7e commit 39cf725

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/sound/webaudio/WebAudioSoundManager.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,12 @@ var WebAudioSoundManager = new Class({
156156
});
157157
};
158158

159-
document.body.addEventListener('touchstart', unlock, false);
160-
document.body.addEventListener('touchend', unlock, false);
161-
document.body.addEventListener('click', unlock, false);
159+
if (document.body)
160+
{
161+
document.body.addEventListener('touchstart', unlock, false);
162+
document.body.addEventListener('touchend', unlock, false);
163+
document.body.addEventListener('click', unlock, false);
164+
}
162165
},
163166

164167
/**

0 commit comments

Comments
 (0)