Check if sound not defined

This commit is contained in:
Caitlin Hennessy 2017-12-04 12:24:41 -08:00
parent 330aff8082
commit 064d6f9411

View File

@ -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());
}
}