fix(tracker): guard for malformed songs in SetSong

This commit is contained in:
5684185+vsariola@users.noreply.github.com 2023-07-17 23:51:14 +03:00
parent c421748db9
commit ccc8dc906f

View File

@ -137,6 +137,10 @@ func (m *Model) ResetSong() {
}
func (m *Model) SetSong(song sointu.Song) {
// guard for malformed songs
if len(song.Score.Tracks) == 0 || song.Score.Length <= 0 || len(song.Patch) == 0 {
return
}
m.saveUndo("SetSong", 0)
m.setSongNoUndo(song)
}