Skip to content

Commit

Permalink
fix PAF NPE issue
Browse files Browse the repository at this point in the history
  • Loading branch information
MherZaqaryan authored Jan 21, 2024
1 parent be99cf2 commit 305fdb4
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,20 @@ public void disband(UUID owner) {

@Override
public boolean isMember(UUID owner, UUID check) {
return getPAFParty(owner).isInParty(PAFPlayerManager.getInstance().getPlayer(Bukkit.getPlayer(check)));
PlayerParty playerParty = getPAFParty(owner);
if (playerParty == null) {
return null;
}
return playerParty.isInParty(PAFPlayerManager.getInstance().getPlayer(Bukkit.getPlayer(check)));
}

@Override
public void removePlayer(UUID owner, UUID target) {
getPAFParty(owner).leaveParty(PAFPlayerManager.getInstance().getPlayer(target));
PlayerParty playerParty = getPAFParty(owner);
if (playerParty == null) {
return null;
}
playerParty.leaveParty(PAFPlayerManager.getInstance().getPlayer(target));
}

@Override
Expand Down

0 comments on commit 305fdb4

Please sign in to comment.