From cbd59975d44cbb77b64b0aaea4c0841876bf8f60 Mon Sep 17 00:00:00 2001 From: Heikki Aitakangas Date: Sun, 13 Feb 2022 21:54:23 +0200 Subject: [PATCH] makeRuntimeRejectMsg expects the 'msg' to be string-like --- src/NetscriptWorker.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/NetscriptWorker.ts b/src/NetscriptWorker.ts index fa55e140b..c28fbb39c 100644 --- a/src/NetscriptWorker.ts +++ b/src/NetscriptWorker.ts @@ -149,8 +149,9 @@ function startNetscript2Script(player: IPlayer, workerScript: WorkerScript): Pro throw e; } - workerScript.errorMessage = makeRuntimeRejectMsg(workerScript, e); - throw new ScriptDeath(workerScript); // Don't know what to do with it, let's rethrow. + // Don't know what to do with it, let's try making an error message out of it + workerScript.errorMessage = makeRuntimeRejectMsg(workerScript, "" + e); + throw new ScriptDeath(workerScript); }); }