Check that result of File#listFiles() is not null.

This commit is contained in:
akwizgran
2016-04-26 17:50:28 +01:00
committed by str4d
parent f73f0aa4ab
commit d06a6e25cb
2 changed files with 6 additions and 2 deletions

View File

@@ -17,7 +17,9 @@ public class TestDatabaseConfig implements DatabaseConfig {
}
public boolean databaseExists() {
return dir.isDirectory() && dir.listFiles().length > 0;
if (!dir.isDirectory()) return false;
File[] files = dir.listFiles();
return files != null && files.length > 0;
}
public File getDatabaseDirectory() {