mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-26 17:43:48 +01:00
Merge pull request #2318 from nickofolas/fix-throw-undefined
Fix throw {nullish} errors
This commit is contained in:
commit
0dbb067eae
@ -22,7 +22,8 @@ export function makeRuntimeRejectMsg(workerScript: WorkerScript, msg: string): s
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (const scriptUrl of workerScript.scriptRef.dependencies) {
|
for (const scriptUrl of workerScript.scriptRef.dependencies) {
|
||||||
msg = msg.replace(new RegExp(scriptUrl.url, "g"), scriptUrl.filename);
|
// Return just the original msg if it's nullish so that we don't get a workerscript error
|
||||||
|
msg = msg?.replace(new RegExp(scriptUrl.url, "g"), scriptUrl.filename) ?? msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
return "|DELIMITER|" + server.hostname + "|DELIMITER|" + workerScript.name + "|DELIMITER|" + msg;
|
return "|DELIMITER|" + server.hostname + "|DELIMITER|" + workerScript.name + "|DELIMITER|" + msg;
|
||||||
|
Loading…
Reference in New Issue
Block a user