fix error in minigame balancer

This commit is contained in:
ajgeiss0702
2021-10-09 14:04:32 -07:00
parent 34e5176430
commit 088ef52d42
@@ -29,7 +29,9 @@ public class MinigameBalancer implements Balancer {
servers.sort(Comparator.comparingInt(o -> {
@SuppressWarnings("unchecked")
Map.Entry<AdaptedServer, AdaptedServerPing> e = (Map.Entry<AdaptedServer, AdaptedServerPing>) o;
return e.getValue().getPlayerCount();
AdaptedServerPing value = e.getValue();
if(value == null) return -1;
return value.getPlayerCount();
}).reversed());
LinkedHashMap<AdaptedServer, AdaptedServerPing> sortedServers = new LinkedHashMap<>();
for(Map.Entry<AdaptedServer, AdaptedServerPing> entry : servers) {