From d05b7becc05771ed88e2f7f2d2aecbf4fb264635 Mon Sep 17 00:00:00 2001 From: Bernat Romagosa Date: Wed, 20 Feb 2019 09:22:11 +0100 Subject: [PATCH] Removes JS error when clicking on "play sound until done" with no sound selected --- src/threads.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/threads.js b/src/threads.js index 72237b3b..8f308a8d 100644 --- a/src/threads.js +++ b/src/threads.js @@ -2226,7 +2226,7 @@ Process.prototype.doPlaySoundUntilDone = function (name) { if (this.context.activeAudio === null) { this.context.activeAudio = sprite.playSound(name); } - if (this.context.activeAudio.ended + if (name === null || this.context.activeAudio.ended || this.context.activeAudio.terminated) { return null; }