From f22bc4f3955479ec7b54e955b03cf2adffbe4d7e Mon Sep 17 00:00:00 2001 From: Xephi Date: Tue, 23 Feb 2016 14:53:29 +0100 Subject: [PATCH] Check if the connection is not null or already closed --- src/main/java/fr/xephi/authme/datasource/SQLite.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/fr/xephi/authme/datasource/SQLite.java b/src/main/java/fr/xephi/authme/datasource/SQLite.java index 5a582be4..f7f18b32 100644 --- a/src/main/java/fr/xephi/authme/datasource/SQLite.java +++ b/src/main/java/fr/xephi/authme/datasource/SQLite.java @@ -350,7 +350,8 @@ public class SQLite implements DataSource { @Override public synchronized void close() { try { - con.close(); + if (con != null && !con.isClosed()) + con.close(); } catch (SQLException ex) { logSqlException(ex); }