Преглед изворни кода

Fixed a NPE when trying to ptp to a non-existing player

TfT_02 пре 12 година
родитељ
комит
145a47c890

+ 1 - 1
Changelog.txt

@@ -17,7 +17,7 @@ Version 1.4.04-dev
  = Fixed bug where Shake wouldn't damage mobs whose max health was less than 4
  = Fixed bug where the API would fail if the name of a player's current party is requested when the player isn't in one (Thanks @dualspiral!)
  = Fixed bug with retrieving a player's party members
- = Fixed bug which caused an NPE when trying to join a non-existing player
+ = Fixed bug which caused an NPE when trying to join the party of a non-existing player or when ptp to a non-existing player
  ! Updated localization files
  - Removed deprecated functions from API classes.
  - Removed functions for getting the PlayerProfile - using API classes is preferred, but if not the McMMOPlayer should be used instead

+ 1 - 1
src/main/java/com/gmail/nossr50/commands/party/teleport/PtpCommand.java

@@ -84,7 +84,7 @@ public class PtpCommand implements CommandExecutor {
     protected static boolean canTeleport(CommandSender sender, Player player, String targetName) {
         mcMMOTarget = UserManager.getPlayer(targetName);
 
-        if (CommandUtils.checkPlayerExistence(sender, targetName, mcMMOTarget)) {
+        if (!CommandUtils.checkPlayerExistence(sender, targetName, mcMMOTarget)) {
             return false;
         }