Skip to content

Commit

Permalink
add nullcheck in GetRomByte() when supplying invalid pcOffset
Browse files Browse the repository at this point in the history
- was causing a crash in export of some games
  • Loading branch information
binary1230 committed Apr 9, 2023
1 parent d3568c0 commit e54b637
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Diz.Core/model/snes/Data.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public void AddComment(int i, string v, bool overwrite)

public byte? GetRomByte(int pcOffset)
{
return RomBytes[pcOffset].Rom;
return pcOffset >= RomBytes.Count ? null : RomBytes[pcOffset].Rom;
}

public byte? GetSnesByte(int snesAddress)
Expand Down

0 comments on commit e54b637

Please sign in to comment.