Fix NPE in the DefaultSessionFactoryLocator

**Cherry-pick to 5.2.x**

(cherry picked from commit 00b771d8a8)
This commit is contained in:
Artem Bilan
2020-02-07 10:51:22 -05:00
parent b75170403b
commit 1bd9954a76

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);
}
}