mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-09 17:23:53 +01:00
BUGFIX: Update NetscriptHelpers.tsx to verify servers are on network when getServer is called (#855)
This commit is contained in:
parent
61c311a126
commit
eed2c5d6d4
@ -460,7 +460,7 @@ function scriptIdentifier(
|
||||
*/
|
||||
function getServer(ctx: NetscriptContext, hostname: string) {
|
||||
const server = GetServer(hostname);
|
||||
if (server == null) {
|
||||
if (server == null || (server.serversOnNetwork.length == 0 && server.hostname != "home")) {
|
||||
const str = hostname === "" ? "'' (empty string)" : "'" + hostname + "'";
|
||||
throw makeRuntimeErrorMsg(ctx, `Invalid hostname: ${str}`);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user