From 3abb35e5060ae934207fc76baf63b63be08b56e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20S=C3=B6derberg?= Date: Fri, 20 Dec 2019 18:01:36 +0100 Subject: [PATCH] Prevent NPE when trying to set `statement = null` in SQLManager If the statement is null, the `isClosed` check will lead to a NPE. As it's going to be null either way, just ignoring the NPE has no side effects. --- .../intellectualsites/plotsquared/plot/database/SQLManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 a62924e9e..cf229e316 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 @@ -375,7 +375,7 @@ import java.util.concurrent.atomic.AtomicInteger; if (statement.isClosed()) { statement = null; } - } catch (AbstractMethodError ignore) { + } catch (NullPointerException | AbstractMethodError ignore) { } } lastTask = task;