fix(tracker): prevent crashing when deleting notes without order list entry

Closes #59
This commit is contained in:
vsariola 2021-04-10 19:21:48 +03:00
parent 4ce6abe1e8
commit 8c7349de12

View File

@ -614,6 +614,9 @@ func (m *Model) DeleteSelection() {
for r := r1; r <= r2; r++ {
s := SongRow{Row: r}.Wrap(m.song.Score)
for c := t1; c <= t2; c++ {
if len(m.song.Score.Tracks[c].Order) <= s.Pattern {
continue
}
p := m.song.Score.Tracks[c].Order[s.Pattern]
if p < 0 {
continue