Skip to content

Commit

Permalink
Avoid NPE on nameCache miss
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanne committed Sep 13, 2021
1 parent 1d94761 commit 853e3a0
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,11 @@ public void integrate(Metadata metadata, SessionFactoryImplementor sessionFactor

@Override
public void disintegrate(SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry) {
metadataMap.remove(nameCache.get(sessionFactory));
nameCache.remove(sessionFactory);
final String name = nameCache.get(sessionFactory);
if (name != null) {
metadataMap.remove(name);
nameCache.remove(sessionFactory);
}
}

public static void clearDsMap() {
Expand Down

0 comments on commit 853e3a0

Please sign in to comment.