From 0ca90fbcb53f567ab2363b0ca8c7e2455a81be7b Mon Sep 17 00:00:00 2001 From: Zrips Date: Fri, 17 Feb 2023 14:42:08 +0200 Subject: [PATCH] Check for null pointer --- pom.xml | 2 +- .../com/gamingmesh/jobs/config/BlockProtectionManager.java | 2 +- src/main/java/com/gamingmesh/jobs/dao/JobsDAO.java | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 025571c5..c68c1da2 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 Jobs jobs - 5.1.2.0 + 5.1.2.2 Jobs http://maven.apache.org diff --git a/src/main/java/com/gamingmesh/jobs/config/BlockProtectionManager.java b/src/main/java/com/gamingmesh/jobs/config/BlockProtectionManager.java index 7a6e51d8..4d420364 100644 --- a/src/main/java/com/gamingmesh/jobs/config/BlockProtectionManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/BlockProtectionManager.java @@ -41,7 +41,7 @@ public class BlockProtectionManager { public void add(Block block, Integer cd) { - if (cd == 0) + if (cd == null || cd == 0) return; // Assuming that block is bottom part of flower we will add top part to the record too diff --git a/src/main/java/com/gamingmesh/jobs/dao/JobsDAO.java b/src/main/java/com/gamingmesh/jobs/dao/JobsDAO.java index 209356e8..191832f7 100644 --- a/src/main/java/com/gamingmesh/jobs/dao/JobsDAO.java +++ b/src/main/java/com/gamingmesh/jobs/dao/JobsDAO.java @@ -44,11 +44,10 @@ import com.gamingmesh.jobs.economy.PaymentData; import com.gamingmesh.jobs.stuff.TimeManage; import com.gamingmesh.jobs.stuff.Util; -import net.Zrips.CMILib.Logs.CMIDebug; import net.Zrips.CMILib.Messages.CMIMessages; public abstract class JobsDAO { - + private JobsConnectionPool pool; private static String prefix; private Jobs plugin;