From ccaf9bf26c08d92efe55da7754c9c6ae052b5fe6 Mon Sep 17 00:00:00 2001 From: Marc Baloup Date: Sun, 1 Dec 2019 23:39:19 +0100 Subject: [PATCH] Check empty SQLWhereChain --- src/main/java/fr/pandacube/util/orm/SQLWhereChain.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/fr/pandacube/util/orm/SQLWhereChain.java b/src/main/java/fr/pandacube/util/orm/SQLWhereChain.java index 7f7d2d7..fe81968 100644 --- a/src/main/java/fr/pandacube/util/orm/SQLWhereChain.java +++ b/src/main/java/fr/pandacube/util/orm/SQLWhereChain.java @@ -23,6 +23,10 @@ public class SQLWhereChain extends SQLWhere { @Override public Pair> toSQL() throws ORMException { + if (conditions.isEmpty()) { + throw new ORMException("SQLWhereChain needs at least one element inside !"); + } + String sql = ""; List params = new ArrayList<>(); boolean first = true;