mirror of
https://github.com/fadden/6502bench.git
synced 2025-08-07 07:28:29 +00:00
Fix crashing bug in Goto
The application would crash if an invalid file offset was entered (with "+xxxx"). This bug has been present since v1.0.
This commit is contained in:
@@ -136,7 +136,10 @@ namespace SourceGen.WpfGui {
|
||||
if (input[0] == '+') {
|
||||
// this can only be an offset; convert as hexadecimal number
|
||||
try {
|
||||
TargetOffset = Convert.ToInt32(input.Substring(1), 16);
|
||||
int offset = Convert.ToInt32(input.Substring(1), 16);
|
||||
if (offset >= 0 && offset < mProject.FileDataLength) {
|
||||
TargetOffset = offset;
|
||||
}
|
||||
} catch (Exception) {
|
||||
}
|
||||
return;
|
||||
|
Reference in New Issue
Block a user