Merge "Fix NPE when scanning change index versions if 'index' dir is missing"

This commit is contained in:
Shawn Pearce 2013-08-21 00:42:48 +00:00 committed by Gerrit Code Review
commit 54c8d27a15

View File

@ -114,6 +114,13 @@ class LuceneVersionManager implements LifecycleListener {
throw fail(e);
}
if (!sitePaths.index_dir.exists()) {
throw new ProvisionException("No index versions ready; run Reindex");
} else if (!sitePaths.index_dir.isDirectory()) {
log.warn("Not a directory: %s", sitePaths.index_dir.getAbsolutePath());
throw new ProvisionException("No index versions ready; run Reindex");
}
TreeMap<Integer, Version> versions = scanVersions(cfg);
// Search from the most recent ready version.
// Write to the most recent ready version and the most recent version.