diff --git a/hibernate-core/src/main/java/org/hibernate/internal/SessionFactoryRegistry.java b/hibernate-core/src/main/java/org/hibernate/internal/SessionFactoryRegistry.java index 41dcfdeb71..bb088710d0 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/SessionFactoryRegistry.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/SessionFactoryRegistry.java @@ -132,7 +132,11 @@ public class SessionFactoryRegistry { public SessionFactory getNamedSessionFactory(String name) { LOG.debugf( "Lookup: name=%s", name ); final String uuid = nameUuidXref.get( name ); - return getSessionFactory( uuid ); + if ( uuid != null ) { + return getSessionFactory( uuid ); + } else { + return null; + } } public SessionFactory getSessionFactory(String uuid) {