From 83e9ec28d5106ecd347453cf1020d3ca2be1b063 Mon Sep 17 00:00:00 2001 From: Gubolin Date: Sat, 2 Aug 2014 16:26:55 +0200 Subject: TypeError (fix #461) --- threads.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'threads.js') diff --git a/threads.js b/threads.js index 3324ac6..2b8e346 100644 --- a/threads.js +++ b/threads.js @@ -1731,15 +1731,18 @@ Process.prototype.blockReceiver = function () { Process.prototype.doPlaySoundUntilDone = function (name) { var sprite = this.homeContext.receiver; - if (this.context.activeAudio === null) { - this.context.activeAudio = sprite.playSound(name); - } - if (this.context.activeAudio.ended - || this.context.activeAudio.terminated) { - return null; + + if (name !== '') { + if (this.context.activeAudio === null) { + this.context.activeAudio = sprite.playSound(name); + } + if (this.context.activeAudio.ended + || this.context.activeAudio.terminated) { + return null; + } + this.pushContext('doYield'); + this.pushContext(); } - this.pushContext('doYield'); - this.pushContext(); }; Process.prototype.doStopAllSounds = function () { -- cgit v1.3.1