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