mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-17 23:08:36 +02:00
MISC: add stopFlag check before running main (#1689)
It's possible that before the script starts runn, the stopFlag is set.
This commit is contained in:
@@ -56,6 +56,9 @@ async function startNetscript2Script(workerScript: WorkerScript): Promise<void>
|
|||||||
|
|
||||||
const loadedModule = await compile(script, scripts);
|
const loadedModule = await compile(script, scripts);
|
||||||
|
|
||||||
|
// if for whatever reason the stopFlag is already set we abort
|
||||||
|
if (workerScript.env.stopFlag) return;
|
||||||
|
|
||||||
if (!loadedModule) throw `${script.filename} cannot be run because the script module won't load`;
|
if (!loadedModule) throw `${script.filename} cannot be run because the script module won't load`;
|
||||||
const mainFunc = loadedModule.main;
|
const mainFunc = loadedModule.main;
|
||||||
// TODO unplanned: Better error for "unexpected reserved word" when using await in non-async function?
|
// TODO unplanned: Better error for "unexpected reserved word" when using await in non-async function?
|
||||||
|
|||||||
Reference in New Issue
Block a user