properly fix leading '/' script bug (#296)

This commit is contained in:
Mughur
2023-01-06 03:33:30 +02:00
committed by GitHub
parent aa32e235fa
commit 3281b785ce
2 changed files with 6 additions and 4 deletions
-3
View File
@@ -421,9 +421,6 @@ export function runScriptFromScript(
return 0;
}
//prevent leading / from causing a bug
if (scriptname.startsWith("/")) scriptname = scriptname.slice(1);
if (typeof scriptname !== "string" || !Array.isArray(args)) {
workerScript.log(caller, () => `Invalid arguments: scriptname='${scriptname} args='${args}'`);
console.error(`runScriptFromScript() failed due to invalid arguments`);