Handle null return value from File.listFiles

This matches the behavior of other call sites.
Fixes andrewgaul/s3proxy#39.
This commit is contained in:
Andrew Gaul 2015-02-03 20:20:59 -08:00
parent 9fc2ca98a0
commit 10690f9293
1 changed files with 3 additions and 0 deletions

View File

@ -673,6 +673,9 @@ public class FilesystemStorageStrategyImpl implements LocalStorageStrategy {
private static void populateBlobKeysInContainer(File directory, Set<String> blobNames,
Function<String, String> function) {
File[] children = directory.listFiles();
if (children == null) {
return;
}
for (File child : children) {
if (child.isFile()) {
blobNames.add( function.apply(child.getAbsolutePath()) );