From 022a1a231ca5e251fd0460b551ae362ad48da9c0 Mon Sep 17 00:00:00 2001 From: Adam Vernon Date: Sun, 30 Oct 2016 14:53:10 -0700 Subject: [PATCH] Confirm Howler.ctx exists before destroying in unload() Refs: #645 --- src/howler.core.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/howler.core.js b/src/howler.core.js index eed2038f..cc65c3bd 100644 --- a/src/howler.core.js +++ b/src/howler.core.js @@ -155,7 +155,7 @@ } // Create a new AudioContext to make sure it is fully reset. - if (self.usingWebAudio && typeof self.ctx.close !== 'undefined') { + if (self.usingWebAudio && self.ctx && typeof self.ctx.close !== 'undefined') { self.ctx.close(); self.ctx = null; setupAudioContext();