HHH-14175 StatefulPersistenceContext#getLoadedCollectionOwnerOrNull could NPE on missing CollectionEntry

Avoids NPE, as the collection entry could not exist.
This commit is contained in:
Jezza 2020-08-14 10:58:01 +02:00 committed by Sanne Grinovero
parent 5ecf45020f
commit 153817f426
1 changed files with 1 additions and 1 deletions

View File

@ -846,7 +846,7 @@ public class StatefulPersistenceContext implements PersistenceContext {
@Override @Override
public Object getLoadedCollectionOwnerOrNull(PersistentCollection collection) { public Object getLoadedCollectionOwnerOrNull(PersistentCollection collection) {
final CollectionEntry ce = getCollectionEntry( collection ); final CollectionEntry ce = getCollectionEntry( collection );
if ( ce.getLoadedPersister() == null ) { if ( ce == null || ce.getLoadedPersister() == null ) {
return null; return null;
} }