fix(gioui): prevent crashing when loading malformed song

This commit is contained in:
vsariola 2021-04-17 23:30:13 +03:00
parent 485b783341
commit ac95fb65c4

View File

@ -55,6 +55,9 @@ func (t *Tracker) loadSong() {
return
}
}
if song.Score.Length <= 0 || len(song.Score.Tracks) == 0 || len(song.Patch) == 0 {
return
}
t.SetSong(song)
t.SetFilePath(filename)
t.window.Option(app.Title(fmt.Sprintf("Sointu Tracker - %v", filename)))