Defensive null check in case Hibernate autoconfig is off
If the Hibernate autoconfig is not used to create an EntityManager then I suppose it's possible that the JpaProperties might be null when everything else is ready for the event to be published. There's no test case because I think it's a corner case. Fxies gh-1075
This commit is contained in:
@@ -73,6 +73,9 @@ class DataSourceInitializedPublisher implements BeanPostProcessor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean isInitializingDatabase() {
|
private boolean isInitializingDatabase() {
|
||||||
|
if (this.properties == null) {
|
||||||
|
return true; // better safe than sorry
|
||||||
|
}
|
||||||
Map<String, String> hibernate = this.properties
|
Map<String, String> hibernate = this.properties
|
||||||
.getHibernateProperties(this.dataSource);
|
.getHibernateProperties(this.dataSource);
|
||||||
if (hibernate.containsKey("hibernate.hbm2ddl.auto")) {
|
if (hibernate.containsKey("hibernate.hbm2ddl.auto")) {
|
||||||
|
|||||||
Reference in New Issue
Block a user