You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Copy file name to clipboardExpand all lines: spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/DataSourceInitializedPublisher.java
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -73,6 +73,9 @@ && isInitializingDatabase()) {
73
73
}
74
74
75
75
privatebooleanisInitializingDatabase() {
76
+
if (this.properties == null) {
77
+
returntrue; // better safe than sorry
78
+
}
76
79
Map<String, String> hibernate = this.properties
77
80
.getHibernateProperties(this.dataSource);
78
81
if (hibernate.containsKey("hibernate.hbm2ddl.auto")) {
0 commit comments