Fix NPE when scanning change index versions if 'index' dir is missing
If the 'index' directory in the review site is missing the scanning for
the change index versions failed with a NullPointerException since
'sitePaths.index_dir.listFiles()' returns null in this case.
The 'index' directory is not created if a new site is initialized but
only when the indexes are generated by running the reindex command.
Hence initializing a new site and switching on Lucene indexing in the
gerrit.config without generating the indexes leads to this error.
Check if the 'index' directory exists and print out an error that the
indexes need to be generated if it is missing.
Change-Id: I9ffff8f643cfecb64ae6014e6451282d06743a28
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
1 file changed