From 4483c2bbce72b5719100475b2418013cbcce2e79 Mon Sep 17 00:00:00 2001 From: SagePtr Date: Sat, 29 Jan 2022 23:30:13 +0200 Subject: [PATCH] Add hasOwnProperty check to GetServer --- src/Server/AllServers.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Server/AllServers.ts b/src/Server/AllServers.ts index baf2d6ac0..2fc994d65 100644 --- a/src/Server/AllServers.ts +++ b/src/Server/AllServers.ts @@ -42,8 +42,11 @@ function GetServerByHostname(hostname: string): BaseServer | null { //Get server by IP or hostname. Returns null if invalid export function GetServer(s: string): BaseServer | null { - const server = AllServers[s]; - if (server) return server; + if (AllServers.hasOwnProperty(s)) { + const server = AllServers[s]; + if (server) return server; + } + if (!isValidIPAddress(s)) { return GetServerByHostname(s); }