From 064d6f9411ac7991a2f6e4c5dcf3bd1d2d42831c Mon Sep 17 00:00:00 2001 From: Caitlin Hennessy Date: Mon, 4 Dec 2017 12:24:41 -0800 Subject: [PATCH] Check if sound not defined --- libs/music/sounds.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/music/sounds.ts b/libs/music/sounds.ts index 464b0e5f..42c9be73 100644 --- a/libs/music/sounds.ts +++ b/libs/music/sounds.ts @@ -284,6 +284,7 @@ namespace music { //% blockId=music_play_sound_effect block="play sound effect %sound" //% weight=99 export function playSoundEffect(sound: Sound) { + if (!sound) return; control.runInBackground(() => sound.play()); } }