mirror of
https://github.com/fadden/6502bench.git
synced 2024-10-10 04:23:44 +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:
parent
d4b97007df
commit
6ff349c2f6
@ -136,7 +136,10 @@ namespace SourceGen.WpfGui {
|
|||||||
if (input[0] == '+') {
|
if (input[0] == '+') {
|
||||||
// this can only be an offset; convert as hexadecimal number
|
// this can only be an offset; convert as hexadecimal number
|
||||||
try {
|
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) {
|
} catch (Exception) {
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user