mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-24 18:22:58 +02:00
throw error when trying to pass non-string or number to other scripts
This commit is contained in:
@@ -646,9 +646,9 @@ export function runScriptFromScript(
|
||||
return 0;
|
||||
}
|
||||
|
||||
args = args.map((arg) => {
|
||||
if (typeof arg === "number") return arg;
|
||||
return arg + ""; // force cast to string
|
||||
args.forEach((arg) => {
|
||||
if (typeof arg !== "string" && typeof arg !== "number")
|
||||
throw new Error("Only strings and numbers can be passed as arguments to otherscripts.");
|
||||
});
|
||||
|
||||
// Check if the script is already running
|
||||
|
||||
Reference in New Issue
Block a user