Prevent NPE on close() if postInit() hasn't been called

Closes #20977
This commit is contained in:
Alexander Schwartz 2023-06-13 18:08:14 +02:00 committed by Hynek Mlnařík
parent c0ac409974
commit f0f664dbb5
2 changed files with 6 additions and 2 deletions

View file

@ -67,7 +67,9 @@ public class JpaRealmProviderFactory implements RealmProviderFactory, ProviderEv
@Override @Override
public void close() { public void close() {
onClose.run(); if (onClose != null) {
onClose.run();
}
} }
@Override @Override

View file

@ -66,7 +66,9 @@ public class LegacyDatastoreProviderFactory implements DatastoreProviderFactory,
@Override @Override
public void close() { public void close() {
onClose.run(); if (onClose != null) {
onClose.run();
}
} }
@Override @Override