From e87e1767b560b6d5fb23aeb8cfcd4ac70ebfcf9b Mon Sep 17 00:00:00 2001 From: Caitlin Hennessy Date: Fri, 8 Dec 2017 11:16:47 -0800 Subject: [PATCH] Null check --- sim/state/sounds.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sim/state/sounds.ts b/sim/state/sounds.ts index e0c39dd4..a43aacde 100644 --- a/sim/state/sounds.ts +++ b/sim/state/sounds.ts @@ -22,7 +22,7 @@ namespace pxsim.SoundMethods { } export function play(buf: RefBuffer, volume: number) { - if (numSoundsPlaying >= soundsLimit) { + if (!buf || numSoundsPlaying >= soundsLimit) { return Promise.resolve(); } return new Promise(resolve => {