From ab7b6ce4604b4f813c00dcce1c5d4cb9c7ab2c52 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Sun, 24 Jun 2012 12:48:03 -0700 Subject: [PATCH] Fixed bug that caused NPE when trying to compare null parties --- Changelog.txt | 1 + src/main/java/com/gmail/nossr50/party/PartyManager.java | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/Changelog.txt b/Changelog.txt index fdcbc9c9a..921c3a1aa 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -15,6 +15,7 @@ Version 1.3.09 + Added API for plugins to add custom tools directly via Spout - repair / abilities do not work ATM + Added offline party members to the list displayed by /party + Added possibility to kick offline members from parties + = Fixed bug that would cause a NPE for players that had no parties = Fixed Vampirism not notifying the correct amount of stolen levels = Fixed bug with Acrobatics not saving you from deadly falls = Fixed /mcremove being applied only after a reload diff --git a/src/main/java/com/gmail/nossr50/party/PartyManager.java b/src/main/java/com/gmail/nossr50/party/PartyManager.java index c92ba83b1..91bc107bc 100644 --- a/src/main/java/com/gmail/nossr50/party/PartyManager.java +++ b/src/main/java/com/gmail/nossr50/party/PartyManager.java @@ -41,6 +41,10 @@ public class PartyManager { * @return true if they are in the same party, false otherwise */ public boolean inSameParty(Player firstPlayer, Player secondPlayer) { + //Since party can be null at times, we need to make sure that it isn't null here + if(Users.getProfile(firstPlayer).getParty() == null || Users.getProfile(secondPlayer).getParty() == null) + return false; + Party firstParty = Users.getProfile(firstPlayer).getParty(); Party secondParty = Users.getProfile(secondPlayer).getParty();