From c693076ab6f3b7d1aeebd60c19f4d91c06b5c036 Mon Sep 17 00:00:00 2001 From: Adam Heath Date: Sun, 26 Jun 2011 18:09:38 +0000 Subject: [PATCH] FIX: Fix NPE in ModelAliasAll.iterator(), when fieldsToExclude is null. git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1139871 13f79535-47bb-0310-9956-ffa450edef68 --- .../entity/src/org/ofbiz/entity/model/ModelViewEntity.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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(); + } } }