diff --git a/hibernate-core/src/main/java/org/hibernate/loader/ast/internal/CollectionLoaderSubSelectFetch.java b/hibernate-core/src/main/java/org/hibernate/loader/ast/internal/CollectionLoaderSubSelectFetch.java index 1a800cb336..25d9e6b501 100644 --- a/hibernate-core/src/main/java/org/hibernate/loader/ast/internal/CollectionLoaderSubSelectFetch.java +++ b/hibernate-core/src/main/java/org/hibernate/loader/ast/internal/CollectionLoaderSubSelectFetch.java @@ -106,7 +106,7 @@ public class CollectionLoaderSubSelectFetch implements CollectionLoader { new CollectionKey( attributeMapping.getCollectionDescriptor(), key.getIdentifier() ) ); - if ( containedCollection != collection ) { + if ( containedCollection != null && containedCollection != collection ) { containedCollection.beginRead(); containedCollection.beforeInitialize( getLoadable().getCollectionDescriptor(), -1 );