mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-10 09:43:54 +01:00
Correctly throw error when ns.run() is called with 0 threads
This commit is contained in:
parent
dd9df0a18c
commit
8fa7b112e1
@ -955,7 +955,7 @@ function NetscriptFunctions(workerScript) {
|
|||||||
if (scriptname === undefined) {
|
if (scriptname === undefined) {
|
||||||
throw makeRuntimeRejectMsg(workerScript, "run() call has incorrect number of arguments. Usage: run(scriptname, [numThreads], [arg1], [arg2]...)");
|
throw makeRuntimeRejectMsg(workerScript, "run() call has incorrect number of arguments. Usage: run(scriptname, [numThreads], [arg1], [arg2]...)");
|
||||||
}
|
}
|
||||||
if (isNaN(threads) || threads < 0) {
|
if (isNaN(threads) || threads <= 0) {
|
||||||
throw makeRuntimeRejectMsg(workerScript, "Invalid argument for thread count passed into run(). Must be numeric and greater than 0");
|
throw makeRuntimeRejectMsg(workerScript, "Invalid argument for thread count passed into run(). Must be numeric and greater than 0");
|
||||||
}
|
}
|
||||||
var argsForNewScript = [];
|
var argsForNewScript = [];
|
||||||
|
Loading…
Reference in New Issue
Block a user