mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-25 02:04:44 +02:00
Fixed bug that caused NPE when trying to compare null parties
This commit is contained in:
@ -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();
|
||||
|
||||
|
Reference in New Issue
Block a user