mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2025-01-13 08:47:34 +01:00
MISC: Show user-friendly error message when script is empty (#1848)
This commit is contained in:
parent
bb7a1fbb22
commit
ab17adf97a
@ -81,6 +81,9 @@ function generateLoadedModule(script: Script, scripts: Map<ScriptFilePath, Scrip
|
||||
return script.mod;
|
||||
}
|
||||
|
||||
if (script.code === "") {
|
||||
throw new Error(`Script content is an empty string. Filename: ${script.filename}, server: ${script.server}.`);
|
||||
}
|
||||
let scriptCode;
|
||||
const fileType = getFileType(script.filename);
|
||||
switch (fileType) {
|
||||
|
Loading…
Reference in New Issue
Block a user