From 799658e1f3d66b72c563750014d1a1e6f9f15213 Mon Sep 17 00:00:00 2001 From: JanHolger Date: Fri, 24 May 2024 15:11:55 +0200 Subject: [PATCH] Added null-check in release --- .../java/org/javawebstack/orm/connection/pool/SQLPool.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/org/javawebstack/orm/connection/pool/SQLPool.java b/src/main/java/org/javawebstack/orm/connection/pool/SQLPool.java index d5052f4..fda3991 100644 --- a/src/main/java/org/javawebstack/orm/connection/pool/SQLPool.java +++ b/src/main/java/org/javawebstack/orm/connection/pool/SQLPool.java @@ -42,6 +42,9 @@ public PooledSQL get() { } public void release(SQL sql) { + if(sql == null) { + throw new IllegalArgumentException("sql must not be null"); + } if(!closing) { if(sql instanceof PooledSQL) { sql.close();