#1463 - NPE in MigrationModel.readMigrations() when running using File resources with no migration directory

This commit is contained in:
rob bygrave
2018-08-07 11:36:26 +12:00
parent 1dd7720605
commit a161d0c01b
@@ -42,9 +42,10 @@ public class MigrationModel {
// find all the migration xml files
File[] xmlFiles = modelDirectory.listFiles(pathname -> pathname.getName().toLowerCase().endsWith(modelSuffix));
if (xmlFiles == null || xmlFiles.length == 0) {
return;
}
List<MigrationResource> resources = new ArrayList<>(xmlFiles.length);
for (File xmlFile : xmlFiles) {
resources.add(new MigrationResource(xmlFile, createVersion(xmlFile)));
}