Skip to content
This repository was archived by the owner on Jul 7, 2023. It is now read-only.

Commit 9384b0f

Browse files
committed
Check for null
1 parent 249770d commit 9384b0f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/main/java/com/massivecraft/factions/zcore/persist/MemoryFaction.java

+8-1
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,10 @@ public int getDeaths() {
326326

327327

328328
public Access getAccess(Permissable permissable, Action action) {
329+
if (permissable == null || action == null) {
330+
return null;
331+
}
332+
329333
Map<Action, Access> accessMap = permissions.get(permissable);
330334
if (accessMap != null && accessMap.containsKey(action)) {
331335
return accessMap.get(action);
@@ -342,6 +346,10 @@ public Access getAccess(Permissable permissable, Action action) {
342346
* @return
343347
*/
344348
public Access getAccess(FPlayer player, Action action) {
349+
if (player == null || action == null) {
350+
return null;
351+
}
352+
345353
Permissable perm;
346354

347355
if (player.getFaction() == this) {
@@ -367,7 +375,6 @@ public void setPermission(Permissable permissable, Action action, Access access)
367375
accessMap.put(action, access);
368376
}
369377

370-
371378
public void resetPerms() {
372379
P.p.log(Level.WARNING, "Resetting permissions for Faction: " + tag);
373380

0 commit comments

Comments
 (0)