diff --git a/src/NetscriptFunctions.ts b/src/NetscriptFunctions.ts index 80a86e3c7..b645b75d6 100644 --- a/src/NetscriptFunctions.ts +++ b/src/NetscriptFunctions.ts @@ -585,10 +585,11 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS { return calculatePercentMoneyHacked(server, Player); }, - hackAnalyzeSecurity: function (_threads: unknown, hostname?: string): number { + hackAnalyzeSecurity: function (_threads: unknown, _hostname?: unknown): number { updateDynamicRam("hackAnalyzeSecurity", getRamCost(Player, "hackAnalyzeSecurity")); let threads = helper.number("hackAnalyzeSecurity", "threads", _threads); - if (hostname) { + if (_hostname) { + const hostname = helper.string("hackAnalyzeSecurity", "hostname", _hostname); const server = safeGetServer(hostname, "hackAnalyze"); if (!(server instanceof Server)) { workerScript.log("hackAnalyzeSecurity", () => "Cannot be executed on this server.");