Skip to content

Commit 70a1e23

Browse files
karlvrbrmeyer
authored andcommitted
HHH-8428 Protect SessionFactoryRegistry.getNamedSessionFactory(String) from NPE
1 parent 5924a1b commit 70a1e23

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

hibernate-core/src/main/java/org/hibernate/internal/SessionFactoryRegistry.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,11 @@ public void removeSessionFactory(
132132
public SessionFactory getNamedSessionFactory(String name) {
133133
LOG.debugf( "Lookup: name=%s", name );
134134
final String uuid = nameUuidXref.get( name );
135-
return getSessionFactory( uuid );
135+
if ( uuid != null ) {
136+
return getSessionFactory( uuid );
137+
} else {
138+
return null;
139+
}
136140
}
137141

138142
public SessionFactory getSessionFactory(String uuid) {

0 commit comments

Comments
 (0)