mirror of
https://github.com/BentoBoxWorld/Limits.git
synced 2024-11-26 12:45:56 +01:00
Add NPE protection
This commit is contained in:
parent
6b9262efc7
commit
f08c45822d
@ -210,13 +210,13 @@ public class Limits extends Addon {
|
|||||||
if (is == null) {
|
if (is == null) {
|
||||||
return LIMIT_NOT_SET;
|
return LIMIT_NOT_SET;
|
||||||
}
|
}
|
||||||
// Check the permissions of the user and update
|
if (user != null) {
|
||||||
this.getJoinListener().checkPerms(user.getPlayer(), gm.getPermissionPrefix() + "island.limit.",
|
// Check the permissions of the user and update
|
||||||
is.getUniqueId(), gm.getDescription().getName());
|
this.getJoinListener().checkPerms(user.getPlayer(), gm.getPermissionPrefix() + "island.limit.",
|
||||||
|
is.getUniqueId(), gm.getDescription().getName());
|
||||||
|
}
|
||||||
int limit = this.getBlockLimitListener().
|
int limit = this.getBlockLimitListener().
|
||||||
getMaterialLimits(is.getWorld(), is.getUniqueId()).
|
getMaterialLimits(is.getWorld(), is.getUniqueId()).getOrDefault(m, -1);
|
||||||
getOrDefault(m, -1);
|
|
||||||
|
|
||||||
return limit == -1 ? LIMIT_NOT_SET : String.valueOf(limit);
|
return limit == -1 ? LIMIT_NOT_SET : String.valueOf(limit);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user