mirror of
https://github.com/whscullin/apple2js.git
synced 2024-01-12 14:14:38 +00:00
error handling
This commit is contained in:
parent
bebe0739c3
commit
a5e5e41e3c
|
@ -322,7 +322,12 @@ function doLoadLocal(drive: DriveNumber, file: File, options: Partial<LoadOption
|
|||
const addressInput = document.querySelector<HTMLInputElement>('#local_file_address');
|
||||
const addressStr = addressInput?.value;
|
||||
if (addressStr) {
|
||||
doLoadBinary(file, { address: parseInt(addressStr, 16), ...options });
|
||||
const address = parseInt(addressStr, 16);
|
||||
if (isNaN(address)) {
|
||||
openAlert('Invalid address: ' + addressStr);
|
||||
return;
|
||||
}
|
||||
doLoadBinary(file, { address, ...options });
|
||||
} else {
|
||||
openAlert('Unknown file type: ' + ext);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user