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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user