404283 org.eclipse.jetty.util.Scanner.scanFile() dies with an NPE if listFiles() returns null

This commit is contained in:
Jan Bartel 2013-03-26 10:55:37 +11:00
parent e553e2ec1f
commit af53d94b8b
1 changed files with 8 additions and 2 deletions

View File

@ -578,8 +578,14 @@ public class Scanner extends AbstractLifeCycle
if (f.isDirectory() && (depth<_scanDepth || _scanDepth==-1 || _scanDirs.contains(f)))
{
File[] files = f.listFiles();
for (int i=0;i<files.length;i++)
scanFile(files[i], scanInfoMap,depth+1);
if (files != null)
{
for (int i=0;i<files.length;i++)
scanFile(files[i], scanInfoMap,depth+1);
}
else
LOG.warn("Error listing files in directory {}", f);
}
}
catch (IOException e)