diff --git a/framework/entity/src/org/ofbiz/entity/model/ModelViewEntity.java b/framework/entity/src/org/ofbiz/entity/model/ModelViewEntity.java index 869d2a5da4..b8cdcdca45 100644 --- a/framework/entity/src/org/ofbiz/entity/model/ModelViewEntity.java +++ b/framework/entity/src/org/ofbiz/entity/model/ModelViewEntity.java @@ -21,6 +21,7 @@ package org.ofbiz.entity.model; import java.io.Serializable; import java.util.Arrays; import java.util.Collection; +import java.util.Collections; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; @@ -792,7 +793,11 @@ public class ModelViewEntity extends ModelEntity { } public Iterator iterator() { - return fieldsToExclude.iterator(); + if (this.fieldsToExclude == null) { + return Collections.emptySet().iterator(); + } else { + return fieldsToExclude.iterator(); + } } }