diff --git a/framework/entity/src/org/ofbiz/entity/GenericDelegator.java b/framework/entity/src/org/ofbiz/entity/GenericDelegator.java index 9d5de8cab1..c5a8dfbc04 100644 --- a/framework/entity/src/org/ofbiz/entity/GenericDelegator.java +++ b/framework/entity/src/org/ofbiz/entity/GenericDelegator.java @@ -2377,7 +2377,13 @@ public class GenericDelegator implements Delegator { String attr = element.getAttribute(name); if (UtilValidate.isNotEmpty(attr)) { - value.setString(name, attr); + // GenericEntity.makeXmlElement() sets null values to GenericEntity.NULL_FIELD.toString(), so look for + // that and treat it as null + if (GenericEntity.NULL_FIELD.toString().equals(attr)) { + value.set(name, null); + } else { + value.setString(name, attr); + } } else { // if no attribute try a subelement Element subElement = UtilXml.firstChildElement(element, name);