Invoke Flyway#setCallbacks only if necessary

Closes gh-14775
This commit is contained in:
Stephane Nicoll 2018-10-11 11:50:53 +02:00
parent 6b22cc1581
commit 81377e2fd5
1 changed files with 3 additions and 1 deletions

View File

@ -149,7 +149,9 @@ public class FlywayAutoConfiguration {
else {
flyway.setDataSource(this.dataSource);
}
flyway.setCallbacks(this.flywayCallbacks.toArray(new FlywayCallback[0]));
if (!this.flywayCallbacks.isEmpty()) {
flyway.setCallbacks(this.flywayCallbacks.toArray(new FlywayCallback[0]));
}
String[] locations = new LocationResolver(flyway.getDataSource())
.resolveLocations(this.properties.getLocations());
checkLocationExists(locations);