MISC: Show user-friendly error message when script is empty ()

This commit is contained in:
catloversg
2024-12-18 18:17:48 +07:00
committed by GitHub
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) {