From e00ef8c001707876065ec54255419717607f58a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=80=E6=BA=90=E6=B5=B7=E5=93=A5?= Date: Tue, 17 Oct 2023 10:56:17 +0800 Subject: [PATCH] fix: NPE, close #I88DFH --- .../com/mybatisflex/core/query/BaseQueryWrapper.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mybatis-flex-core/src/main/java/com/mybatisflex/core/query/BaseQueryWrapper.java b/mybatis-flex-core/src/main/java/com/mybatisflex/core/query/BaseQueryWrapper.java index 46a0b03b..83305084 100644 --- a/mybatis-flex-core/src/main/java/com/mybatisflex/core/query/BaseQueryWrapper.java +++ b/mybatis-flex-core/src/main/java/com/mybatisflex/core/query/BaseQueryWrapper.java @@ -54,6 +54,7 @@ public class BaseQueryWrapper> implements CloneSup *

Title: clear.

*

Description: Default QueryWrapper values.

*

Notice: When adding new attributes, it is necessary to supplement here.

+ * * @author dragon */ public void clear() { @@ -95,11 +96,12 @@ public class BaseQueryWrapper> implements CloneSup protected T setWhereQueryCondition(QueryCondition queryCondition) { - if (whereQueryCondition != null) { - queryCondition.connect(whereQueryCondition, SqlConnector.AND); + if (queryCondition != null) { + if (whereQueryCondition != null) { + queryCondition.connect(whereQueryCondition, SqlConnector.AND); + } + whereQueryCondition = queryCondition; } - - whereQueryCondition = queryCondition; return (T) this; } @@ -120,7 +122,6 @@ public class BaseQueryWrapper> implements CloneSup if (groupByColumns == null) { groupByColumns = new ArrayList<>(); } - groupByColumns.add(queryColumn); return (T) this; }