diff --git a/src/main/java/com/gamingmesh/jobs/PermissionHandler.java b/src/main/java/com/gamingmesh/jobs/PermissionHandler.java index c97028da..9c0ae5b2 100644 --- a/src/main/java/com/gamingmesh/jobs/PermissionHandler.java +++ b/src/main/java/com/gamingmesh/jobs/PermissionHandler.java @@ -184,6 +184,8 @@ public class PermissionHandler { for (Entry one : condition.getPerformPerm().entrySet()) { String perm = one.getKey(); + if (perm == null || perm.isEmpty()) + continue; if (one.getValue()) permissions.put(perm, true); else { diff --git a/src/main/java/com/gamingmesh/jobs/container/JobConditions.java b/src/main/java/com/gamingmesh/jobs/container/JobConditions.java index 35981e62..7a66e73a 100644 --- a/src/main/java/com/gamingmesh/jobs/container/JobConditions.java +++ b/src/main/java/com/gamingmesh/jobs/container/JobConditions.java @@ -47,7 +47,11 @@ public class JobConditions { continue; } - requiresJobs.put(split[0], jobLevel); + String perm = split[0]; + if (perm == null || perm.isEmpty()) + continue; + + requiresJobs.put(perm, jobLevel); } if (cond.contains("p:")) { @@ -62,10 +66,20 @@ public class JobConditions { continue; String clean = one.substring("p:".length()); - String[] split = clean.split("-", 2); - if (split.length > 1) { - performPerm.put(split[0], split[1].equalsIgnoreCase("true")); + if (clean == null || clean.isEmpty()) + continue; + + String[] split = clean.split("-", 2); + + if (split.length > 1) { + + String perm = split[0]; + if (perm == null || perm.isEmpty()) + continue; + boolean value = split[1].equalsIgnoreCase("true"); + + performPerm.put(perm, value); } else { performPerm.put(clean, true); }