mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-22 22:22:26 +01:00
Fix #2275 accepts NaN donation bug
This commit is contained in:
parent
f9fd7a48f8
commit
3ca36fca95
@ -1179,8 +1179,7 @@ export function NetscriptSingularity(
|
|||||||
helper.updateDynamicRam("donateToFaction", getRamCost("donateToFaction"));
|
helper.updateDynamicRam("donateToFaction", getRamCost("donateToFaction"));
|
||||||
helper.checkSingularityAccess("donateToFaction", 3);
|
helper.checkSingularityAccess("donateToFaction", 3);
|
||||||
const faction = getFaction("donateToFaction", name);
|
const faction = getFaction("donateToFaction", name);
|
||||||
|
if (typeof amt !== "number" || amt <= 0 || isNaN(amt)) {
|
||||||
if (typeof amt !== "number" || amt <= 0) {
|
|
||||||
workerScript.log("donateToFaction", () => `Invalid donation amount: '${amt}'.`);
|
workerScript.log("donateToFaction", () => `Invalid donation amount: '${amt}'.`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user