Don't crash when attempt servers order is empty, return empty optional instead (#576)

This commit is contained in:
sagan
2021-09-15 05:42:14 -06:00
committed by GitHub
parent d1135bd190
commit ea07c6661a

View File

@@ -690,7 +690,12 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
}
if (serversToTry.isEmpty()) {
serversToTry = server.getConfiguration().getAttemptConnectionOrder();
List<String> connOrder = server.getConfiguration().getAttemptConnectionOrder();
if (connOrder.isEmpty()) {
return Optional.empty();
} else {
serversToTry = connOrder;
}
}
for (int i = tryIndex; i < serversToTry.size(); i++) {