fix: fixed bug where too many wrong events would cause a null pointer
This commit is contained in:
@ -194,9 +194,9 @@ public class Lobby {
|
||||
|
||||
Optional<Participant> getParticipantForEntityType(EntityType type) {
|
||||
if (type == EntityType.P1) {
|
||||
return Optional.of(connection.getPlayer1());
|
||||
return Optional.ofNullable(connection.getPlayer1());
|
||||
} else if (type == EntityType.P2) {
|
||||
return Optional.of(connection.getPlayer2());
|
||||
return Optional.ofNullable(connection.getPlayer2());
|
||||
} else {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
Reference in New Issue
Block a user