Merge pull request #2342 from woody-lam-cwl/nan-donation

Fix #2275 accepts NaN donation bug
This commit is contained in:
hydroflame 2022-01-05 10:16:01 -05:00 committed by GitHub
commit 0ea139d2f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1189,7 +1189,7 @@ export function NetscriptSingularity(
);
return false;
}
if (typeof amt !== "number" || amt <= 0) {
if (typeof amt !== "number" || amt <= 0 || isNaN(amt)) {
workerScript.log("donateToFaction", () => `Invalid donation amount: '${amt}'.`);
return false;
}