Check to ensure the child object returned is not null before adding to list of child objects to validate.

This commit is contained in:
Matthew Porter 2005-04-10 21:10:03 +00:00
parent d6f2b136ec
commit 625efa4782
1 changed files with 4 additions and 2 deletions

View File

@ -122,8 +122,10 @@ public class IntrospectionManagerHibernate implements IntrospectionManager,
// only if a Validator is registered for that Object
if (this.validationRegistryManager.findValidator(
propertyType.getReturnedClass()) != null) {
allObjects.add(classMetadata.getPropertyValue(
parentObject, propertyNames[i], EntityMode.POJO));
Object childObject = classMetadata.getPropertyValue(parentObject, propertyNames[i], EntityMode.POJO);
if (childObject != null) {
allObjects.add(childObject);
}
}
}
}