CORPORATION: Fix wrong error message in buyMaterial API (#1234)

This commit is contained in:
catloversg 2024-04-27 16:10:58 +07:00 committed by GitHub
parent de8883ed0f
commit dc4a85e591
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -353,7 +353,7 @@ export function NetscriptCorporation(): InternalAPI<NSCorporation> {
const materialName = getEnumHelper("CorpMaterialName").nsGetMember(ctx, _materialName, "materialName");
const amt = helpers.number(ctx, "amt", _amt);
if (amt < 0 || !Number.isFinite(amt))
throw new Error("Invalid value for amount field! Must be numeric and greater than 0");
throw new Error("Invalid value for amount field! Must be numeric and greater than or equal to 0");
const material = getMaterial(divisionName, cityName, materialName);
BuyMaterial(division, material, amt);
},