Fixed: NullPointerException when calling EntityQuery#getFieldList

(OFBIZ-9624)

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
This commit is contained in:
Jacques Le Roux
2017-08-25 19:49:15 +00:00
parent 1cc65c1d2b
commit 29a3f4d2f1
@@ -521,7 +521,7 @@ public class EntityQuery {
public <T> List<T> getFieldList(final String fieldName) throws GenericEntityException {select(fieldName);
try (EntityListIterator genericValueEli = queryIterator()) {
if (this.distinct) {
if (Boolean.TRUE.equals(this.distinct)) {
Set<T> distinctSet = new HashSet<T>();
GenericValue value = null;
while ((value = genericValueEli.next()) != null) {