From 29a3f4d2f185acf010502171b32f4d53464fa980 Mon Sep 17 00:00:00 2001 From: Jacques Le Roux Date: Fri, 25 Aug 2017 19:49:15 +0000 Subject: [PATCH] Fixed: NullPointerException when calling EntityQuery#getFieldList (OFBIZ-9624) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When performing EntityQuery#getFieldList without specifying distinct a NullPointerException is thrown, because of the condition if (this.distinct). It implicitly calls this.distinct.booleanValue() which throws the exception if distinct is null. Thanks: Tobias Laufkötter git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1806220 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/java/org/apache/ofbiz/entity/util/EntityQuery.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityQuery.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityQuery.java index 9ba97253a4..3154ec9986 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityQuery.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityQuery.java @@ -521,7 +521,7 @@ public class EntityQuery { public List getFieldList(final String fieldName) throws GenericEntityException {select(fieldName); try (EntityListIterator genericValueEli = queryIterator()) { - if (this.distinct) { + if (Boolean.TRUE.equals(this.distinct)) { Set distinctSet = new HashSet(); GenericValue value = null; while ((value = genericValueEli.next()) != null) {