make sure the directory exists before listing files (this could only happen if instanceDir is invalid)

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@702528 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Ryan McKinley 2008-10-07 16:13:02 +00:00
parent dd04d0fc2e
commit 9465b6bc29
1 changed files with 4 additions and 2 deletions

View File

@ -1440,8 +1440,10 @@ public final class SolrCore implements SolrInfoMBean {
// Hide everything... // Hide everything...
Set<String> hide = new HashSet<String>(); Set<String> hide = new HashSet<String>();
File configdir = new File( solrConfig.getResourceLoader().getConfigDir() ); File configdir = new File( solrConfig.getResourceLoader().getConfigDir() );
for( String file : configdir.list() ) { if( configdir.exists() && configdir.isDirectory() ) {
hide.add( file.toUpperCase() ); for( String file : configdir.list() ) {
hide.add( file.toUpperCase() );
}
} }
// except the "gettable" list // except the "gettable" list