From faa360e107a32bcd74e50cface73d88e776eb300 Mon Sep 17 00:00:00 2001 From: addstar Date: Sat, 23 Aug 2014 21:42:01 +1000 Subject: [PATCH] Fix NPE when getInvitedId is null (game in progress or no invited player) --- src/main/java/me/desht/chesscraft/commands/JoinCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/me/desht/chesscraft/commands/JoinCommand.java b/src/main/java/me/desht/chesscraft/commands/JoinCommand.java index 4cc8227a..9803a0a3 100644 --- a/src/main/java/me/desht/chesscraft/commands/JoinCommand.java +++ b/src/main/java/me/desht/chesscraft/commands/JoinCommand.java @@ -38,7 +38,7 @@ public boolean execute(Plugin plugin, CommandSender sender, String[] args) throw } else { // find a game (or games) with an invitation for us for (ChessGame game : cMgr.listGames()) { - if (game.getInvitedId().equals(player.getUniqueId())) { + if ((game.getInvitedId() != null) && (game.getInvitedId().equals(player.getUniqueId()))) { colour = game.addPlayer(player.getUniqueId().toString(), player.getDisplayName()); gameName = game.getName(); }