Commit d6fa4bf

Nick Faro committed on
Don't crash when invalid note is present in song
commit d6fa4bf7a1c390564c3fb8faaa8d16b7192fa2d0 parent e4a2a07
1 changed files +2−2
Modifiedcodegen.pas +2−2
@@ -36,7 +36,7 @@ procedure RenderSongToGBDKC(Song: TSong; DescriptorName: String; Filename: strin
36 SL := TStringList.Create; 36 SL := TStringList.Create;
37 SL.Delimiter := ','; 37 SL.Delimiter := ',';
38 38
39 if Cell.Note = NO_NOTE then 39 if (Cell.Note = NO_NOTE) or (NoteToCMap.IndexOf(Cell.Note) = -1) then
40 SL.Add('___') 40 SL.Add('___')
41 else 41 else
42 SL.Add(NoteToCMap.KeyData[Cell.Note]); 42 SL.Add(NoteToCMap.KeyData[Cell.Note]);
@@ -353,7 +353,7 @@ begin
353 SL.Delimiter := ','; 353 SL.Delimiter := ',';
354 SL.StrictDelimiter := True; 354 SL.StrictDelimiter := True;
355 355
356 if Cell.Note = NO_NOTE then 356 if (Cell.Note = NO_NOTE) or (NoteToDriverMap.IndexOf(Cell.Note) = -1) then
357 SL.Add('___') 357 SL.Add('___')
358 else 358 else
359 SL.Add(NoteToDriverMap.KeyData[Cell.Note]); 359 SL.Add(NoteToDriverMap.KeyData[Cell.Note]);