clean up some null checks

This commit is contained in:
Ingmar Goudt 2018-09-27 22:16:32 +02:00
parent 188a09b8fb
commit 7b4acbe386
3 changed files with 6 additions and 11 deletions

View file

@ -266,13 +266,13 @@ public class GameController implements GameCallback {
public void join(UUID userId) {
UUID playerId = userPlayerMap.get(userId);
Optional<User> user = UserManager.instance.getUser(userId);
if (userId == null || playerId == null) {
if (playerId == null) {
logger.fatal("Join game failed!");
logger.fatal("- gameId: " + game.getId());
logger.fatal("- userId: " + userId);
return;
}
Optional<User> user = UserManager.instance.getUser(userId);
if (!user.isPresent()) {
logger.fatal("User not found : " + userId);
return;