HHH-12539 - NPE in AbstractPropertyMapping.getCommonPersistentClass when creating UnionSubclassEntityPersister for dynamic-map

This commit is contained in:
Andrea Boriero 2018-05-08 13:44:30 +01:00
parent 0cf49496ff
commit d926bc15e5
1 changed files with 2 additions and 1 deletions

View File

@ -269,7 +269,8 @@ public abstract class AbstractPropertyMapping implements PropertyMapping {
}
private PersistentClass getCommonPersistentClass(PersistentClass clazz1, PersistentClass clazz2) {
while ( clazz2 != null && !clazz2.getMappedClass().isAssignableFrom( clazz1.getMappedClass() ) ) {
while ( clazz2 != null && clazz2.getMappedClass() != null && clazz1.getMappedClass() != null && !clazz2.getMappedClass()
.isAssignableFrom( clazz1.getMappedClass() ) ) {
clazz2 = clazz2.getSuperclass();
}
return clazz2;