Merge pull request #2872 from SagePtr/getserver-hasownproperty

Add hasOwnProperty check to GetServer
This commit is contained in:
hydroflame 2022-03-20 21:16:04 -04:00 committed by GitHub
commit 15fae213ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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 {
if (AllServers.hasOwnProperty(s)) {
const server = AllServers[s];
if (server) return server;
}
if (!isValidIPAddress(s)) {
return GetServerByHostname(s);
}