mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-17 13:13:49 +01: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:
parent
4d60c833cc
commit
ccd9118b93
@ -56,6 +56,9 @@ async function startNetscript2Script(workerScript: WorkerScript): Promise<void>
|
||||
|
||||
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`;
|
||||
const mainFunc = loadedModule.main;
|
||||
// TODO unplanned: Better error for "unexpected reserved word" when using await in non-async function?
|
||||
|
Loading…
Reference in New Issue
Block a user