Skip to content

Commit 81377e2

Browse files
committed
Invoke Flyway#setCallbacks only if necessary
Closes gh-14775
1 parent 6b22cc1 commit 81377e2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,9 @@ else if (this.flywayDataSource != null) {
149149
else {
150150
flyway.setDataSource(this.dataSource);
151151
}
152-
flyway.setCallbacks(this.flywayCallbacks.toArray(new FlywayCallback[0]));
152+
if (!this.flywayCallbacks.isEmpty()) {
153+
flyway.setCallbacks(this.flywayCallbacks.toArray(new FlywayCallback[0]));
154+
}
153155
String[] locations = new LocationResolver(flyway.getDataSource())
154156
.resolveLocations(this.properties.getLocations());
155157
checkLocationExists(locations);

0 commit comments

Comments
 (0)