mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2025-01-14 09:27:33 +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;
|
return script.mod;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (script.code === "") {
|
||||||
|
throw new Error(`Script content is an empty string. Filename: ${script.filename}, server: ${script.server}.`);
|
||||||
|
}
|
||||||
let scriptCode;
|
let scriptCode;
|
||||||
const fileType = getFileType(script.filename);
|
const fileType = getFileType(script.filename);
|
||||||
switch (fileType) {
|
switch (fileType) {
|
||||||
|
Loading…
Reference in New Issue
Block a user