mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-22 17:23:00 +02:00
UI: Do not close scripts in editor when their servers are deleted (#2049)
This commit is contained in:
@@ -7,7 +7,9 @@ import { throwIfReachable } from "../../utils/helpers/throwIfReachable";
|
||||
function getServerCode(scripts: OpenScript[], index: number): string | null {
|
||||
const openScript = scripts[index];
|
||||
const server = GetServer(openScript.hostname);
|
||||
if (server === null) throw new Error(`Server '${openScript.hostname}' should not be null, but it is.`);
|
||||
if (server === null) {
|
||||
return null;
|
||||
}
|
||||
const data = server.getContentFile(openScript.path)?.content ?? null;
|
||||
return data;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user