Prevent NPE

@Poslovich - you were right!
This commit is contained in:
tastybento 2021-10-11 17:15:51 -07:00
parent db464d5c04
commit 765f774652
1 changed files with 1 additions and 1 deletions

View File

@ -128,7 +128,7 @@ public abstract class FlagListener implements Listener {
// Set user
user = player == null ? null : User.getInstance(player);
if (loc == null) {
if (user.getLocation() != null && user.getLocation().getWorld() != null) {
if (user != null && user.getLocation() != null && user.getLocation().getWorld() != null) {
report(user, e, user.getLocation(), flag, Why.NULL_LOCATION);
}
return true;