mirror of
https://github.com/vsariola/sointu.git
synced 2025-05-28 03:10:24 -04:00
fix(tracker): guard for malformed songs in SetSong
This commit is contained in:
parent
c421748db9
commit
ccc8dc906f
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user