From 39cf7252c9a3184a47da19575d105d6c930d6a3c Mon Sep 17 00:00:00 2001 From: Richard Davey Date: Wed, 9 May 2018 13:45:47 +0100 Subject: [PATCH] Check if body exists. Fix #3649. --- src/sound/webaudio/WebAudioSoundManager.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/sound/webaudio/WebAudioSoundManager.js b/src/sound/webaudio/WebAudioSoundManager.js index f0c48bde5..d36a31747 100644 --- a/src/sound/webaudio/WebAudioSoundManager.js +++ b/src/sound/webaudio/WebAudioSoundManager.js @@ -156,9 +156,12 @@ var WebAudioSoundManager = new Class({ }); }; - document.body.addEventListener('touchstart', unlock, false); - document.body.addEventListener('touchend', unlock, false); - document.body.addEventListener('click', unlock, false); + if (document.body) + { + document.body.addEventListener('touchstart', unlock, false); + document.body.addEventListener('touchend', unlock, false); + document.body.addEventListener('click', unlock, false); + } }, /**