make sure server ping is null if the server isnt online

This commit is contained in:
ajgeiss0702
2021-08-25 09:01:41 -07:00
parent e43967ecb4
commit 1125dbeb85
2 changed files with 5 additions and 2 deletions
@@ -160,7 +160,10 @@ public class QueueServerImpl implements QueueServer {
maxPlayers = 0;
for(AdaptedServer pingedServer : pings.keySet()) {
AdaptedServerPing serverPing = pings.get(pingedServer);
if(serverPing == null) {
if(serverPing == null || serverPing.getPlainDescription() == null) {
if(serverPing != null) {
pings.put(pingedServer, null);
}
continue;
}
if(serverPing.getPlainDescription().contains("ajQueue;whitelisted=")) {
@@ -24,7 +24,7 @@ public class BungeeServerPing implements AdaptedServerPing {
@Override
public String getPlainDescription() {
BaseComponent desc = handle.getDescriptionComponent();
if(desc == null) return "";
if(desc == null) return null;
return desc.toPlainText();
}