From 9cf322ca0b8e4f686d56dfd139439156b15d8c05 Mon Sep 17 00:00:00 2001 From: TfT_02 Date: Tue, 5 Mar 2013 00:30:07 +0100 Subject: [PATCH] Fixed NPE with /ptp --- .../java/com/gmail/nossr50/commands/party/PtpCommand.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gmail/nossr50/commands/party/PtpCommand.java b/src/main/java/com/gmail/nossr50/commands/party/PtpCommand.java index 4d446d39f..c3ddb1c41 100644 --- a/src/main/java/com/gmail/nossr50/commands/party/PtpCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/party/PtpCommand.java @@ -32,6 +32,9 @@ public class PtpCommand implements CommandExecutor { switch (args.length) { case 1: + player = (Player) sender; + mcMMOPlayer = UserManager.getPlayer(player); + if (args[0].equalsIgnoreCase("toggle")) { if (!Permissions.partyTeleportToggle(sender)) { sender.sendMessage(command.getPermissionMessage()); @@ -50,7 +53,6 @@ public class PtpCommand implements CommandExecutor { return acceptAnyTeleportRequest(); } - player = (Player) sender; int ptpCooldown = Config.getInstance().getPTPCommandCooldown(); long recentlyHurt = UserManager.getPlayer(player).getRecentlyHurt() * Misc.TIME_CONVERSION_FACTOR;