Merge pull request #3355 from stianst/KEYCLOAK-2699

KEYCLOAK-2699 Potential for NPE in DirImportProvider.getRealmsToImport
This commit is contained in:
Stian Thorgersen 2016-10-19 07:35:54 +02:00 committed by GitHub
commit 13220e1d38

View file

@ -62,6 +62,10 @@ public class DirImportProvider implements ImportProvider {
public DirImportProvider(File rootDirectory) { public DirImportProvider(File rootDirectory) {
this.rootDirectory = rootDirectory; this.rootDirectory = rootDirectory;
if (!this.rootDirectory.exists()) {
throw new IllegalStateException("Directory " + this.rootDirectory + " doesn't exists");
}
logger.infof("Importing from directory %s", this.rootDirectory.getAbsolutePath()); logger.infof("Importing from directory %s", this.rootDirectory.getAbsolutePath());
} }