diff --git a/CHANGELOG.md b/CHANGELOG.md index a17e9b5fa..532bb2921 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix issue where adding a new song wouldn't warn about unsaved changes in current song - Fix issue where adding a song with an already existing name wouldn't auto select the newly created song - Fix issue where scene connection lines could get stuck in place if custom scripts that change scenes are called multiple times from the same scene -- Fix issue where "Replace Script" confirmation alert would appear when pasting sometimes even if the custom script hadn't been modified +- Fix issue where "Replace Script" confirmation alert would appear when pasting sometimes even if the custom script hadn't been modified +- Fix issue preventing building projects containing a "Play Music" event but no music ## [4.1.2] - 2024-09-09 diff --git a/src/lib/compiler/compileData.ts b/src/lib/compiler/compileData.ts index 79e554380..ce95ab601 100755 --- a/src/lib/compiler/compileData.ts +++ b/src/lib/compiler/compileData.ts @@ -882,9 +882,9 @@ export const precompileMusic = ( cmd.args && (cmd.args.musicId !== undefined || cmd.command === EVENT_MUSIC_PLAY) ) { - const musicId = ensureString(cmd.args.musicId, music[0].id); + const musicId = ensureString(cmd.args.musicId, music[0]?.id ?? ""); // If never seen this track before add it to the list - if (usedMusicIds.indexOf(musicId) === -1) { + if (musicId.length > 0 && usedMusicIds.indexOf(musicId) === -1) { usedMusicIds.push(musicId); } } else if (eventHasArg(cmd, "references")) { @@ -913,7 +913,7 @@ export const precompileMusic = ( id: track.id, }; }) - .filter((track) => track) + .filter((track) => track.symbol) .map((track) => { return { ...track,