From e6a7f4e5a70a99b2a028e97bf428453e52e76594 Mon Sep 17 00:00:00 2001 From: MattBDev <4009945+MattBDev@users.noreply.github.com> Date: Tue, 6 Aug 2019 20:45:01 -0400 Subject: [PATCH] Add null checks to validation task Fixes #2407 --- .../plotsquared/plot/database/SQLManager.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/SQLManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/SQLManager.java index 4ac78e122..49fbc0bc9 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/SQLManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/SQLManager.java @@ -2853,6 +2853,16 @@ import java.util.concurrent.atomic.AtomicInteger; if (plot.temp == -1) { continue; } + if (plot.getArea() == null) { + PlotSquared.debug("CRITICAL ERROR IN VALIDATION TASK!"); + PlotSquared.debug("PLOT AREA CANNOT BE NULL! SKIPPING PLOT!"); + continue; + } + if (database == null) { + PlotSquared.debug("CRITICAL ERROR IN VALIDATION TASK!"); + PlotSquared.debug("DATABASE VARIABLE CANNOT BE NULL! NOW ENDING VALIDATION!!"); + break; + } HashMap worldPlots = database.get(plot.getArea().toString()); if (worldPlots == null) { PlotSquared.debug("&8 - &7Creating plot (1): " + plot);