Fix NPE in the DefaultSessionFactoryLocator

**Cherry-pick to 5.2.x**
This commit is contained in:
Artem Bilan
2020-02-07 10:51:22 -05:00
parent edf84a393d
commit 00b771d8a8

View File

@@ -89,7 +89,9 @@ public class DefaultSessionFactoryLocator<F> implements SessionFactoryLocator<F>
@Override
public SessionFactory<F> getSessionFactory(@Nullable Object key) {
return this.factories.getOrDefault(key, this.defaultFactory);
return key == null
? this.defaultFactory
: this.factories.getOrDefault(key, this.defaultFactory);
}
}