diff --git a/src/NetscriptFunctions/Singularity.ts b/src/NetscriptFunctions/Singularity.ts index 99b960856..ac40460e6 100644 --- a/src/NetscriptFunctions/Singularity.ts +++ b/src/NetscriptFunctions/Singularity.ts @@ -1179,8 +1179,7 @@ export function NetscriptSingularity( helper.updateDynamicRam("donateToFaction", getRamCost("donateToFaction")); helper.checkSingularityAccess("donateToFaction", 3); const faction = getFaction("donateToFaction", name); - - if (typeof amt !== "number" || amt <= 0) { + if (typeof amt !== "number" || amt <= 0 || isNaN(amt)) { workerScript.log("donateToFaction", () => `Invalid donation amount: '${amt}'.`); return false; }