diff --git a/Server/src/main/java/uulm/teamname/marvelous/server/lobby/Lobby.java b/Server/src/main/java/uulm/teamname/marvelous/server/lobby/Lobby.java index 3d6e5be..c0498d7 100644 --- a/Server/src/main/java/uulm/teamname/marvelous/server/lobby/Lobby.java +++ b/Server/src/main/java/uulm/teamname/marvelous/server/lobby/Lobby.java @@ -194,9 +194,9 @@ public class Lobby { Optional 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(); }