Null check

This commit is contained in:
Caitlin Hennessy 2017-12-08 11:16:47 -08:00
parent 2d7a108e79
commit e87e1767b5

View File

@ -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<void>(resolve => {