mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 23:26:45 +01:00
Fix for NPE on party checks due to CombatTag plugin.
This commit is contained in:
parent
533955a9c7
commit
32e9de6e9a
@ -41,8 +41,18 @@ public class PartyManager {
|
||||
* @return true if they are in the same party, false otherwise
|
||||
*/
|
||||
public boolean inSameParty(Player firstPlayer, Player secondPlayer) {
|
||||
if (Users.getProfile(firstPlayer).getParty() == null || Users.getProfile(secondPlayer).getParty() == null
|
||||
|| !Users.getProfile(firstPlayer).getParty().equals(Users.getProfile(secondPlayer).getParty())) {
|
||||
if (Users.getProfile(firstPlayer) == null) {
|
||||
plugin.getLogger().info("The defending player's profile was null.");
|
||||
plugin.getLogger().info("This player is online: " + firstPlayer.isOnline());
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Users.getProfile(secondPlayer) == null) {
|
||||
plugin.getLogger().info("The attacking player's profile was null.");
|
||||
plugin.getLogger().info("This player is online: " + secondPlayer.isOnline());
|
||||
return false;
|
||||
}
|
||||
if (Users.getProfile(firstPlayer).getParty() == null || Users.getProfile(secondPlayer).getParty() == null || !Users.getProfile(firstPlayer).getParty().equals(Users.getProfile(secondPlayer).getParty())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user