Fixed issue with deserialization from XML of an entity value with null fields
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1458429 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user