mirror of
https://github.com/bloodmc/GriefDefender.git
synced 2024-11-25 12:45:48 +01:00
Fix NPE during pvp protection checks.
This commit is contained in:
parent
e79100c6f1
commit
d043037d26
@ -399,7 +399,7 @@ public boolean protectEntity(Event event, Object source, Entity targetEntity) {
|
||||
GDPermissionUser user = null;
|
||||
if (source instanceof Player && targetUser != null) {
|
||||
user = PermissionHolderCache.getInstance().getOrCreateUser(((Player) source).getUniqueId());
|
||||
if (user.getOnlinePlayer() != null) {
|
||||
if (user.getOnlinePlayer() != null && targetUser.getOnlinePlayer() != null) {
|
||||
return this.getPvpProtectResult(event, claim, user, targetUser);
|
||||
}
|
||||
}
|
||||
@ -422,7 +422,7 @@ public boolean protectEntity(Event event, Object source, Entity targetEntity) {
|
||||
}
|
||||
if (owner != null && targetUser != null && !owner.equals(targetUser.getUniqueId())) {
|
||||
final GDPermissionUser sourceUser = PermissionHolderCache.getInstance().getOrCreateUser(owner);
|
||||
if (sourceUser.getOnlinePlayer() != null) {
|
||||
if (sourceUser.getOnlinePlayer() != null && targetUser.getOnlinePlayer() != null) {
|
||||
return this.getPvpProtectResult(event, claim, sourceUser, targetUser);
|
||||
}
|
||||
}
|
||||
|
@ -500,7 +500,7 @@ public boolean protectEntity(Event event, Entity targetEntity, Cause cause, Dama
|
||||
final GDPermissionUser targetUser = targetEntity instanceof Player ? PermissionHolderCache.getInstance().getOrCreateUser((Player) targetEntity) : null;
|
||||
if (source instanceof Player && targetUser != null) {
|
||||
final GDPermissionUser sourceUser = PermissionHolderCache.getInstance().getOrCreateUser(((Player) source).getUniqueId());
|
||||
if (sourceUser.getOnlinePlayer() != null) {
|
||||
if (sourceUser.getOnlinePlayer() != null && targetUser.getOnlinePlayer() != null) {
|
||||
return this.getPvpProtectResult(event, claim, sourceUser, targetUser);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user