Skip to content

Commit 3349d8a

Browse files
committed
catch index out of bounds
1 parent 485579a commit 3349d8a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/lowtuna/jsonblob/core/BlobCleanupProducer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ protected boolean handleDirectory(File directory, int depth, Collection<Void> re
6464
log.info("{} has no files, so it's being deleted", directory.getAbsolutePath());
6565
} else if (fileCount.get() == 1) {
6666
File[] files = directory.listFiles();
67-
if (files != null && files[0].getName().startsWith(FileSystemJsonBlobManager.BLOB_METADATA_FILE_NAME)) {
67+
if (files != null && files.length > 0 && files[0].getName().startsWith(FileSystemJsonBlobManager.BLOB_METADATA_FILE_NAME)) {
6868
if (files[0].delete() && directory.delete()) {
6969
log.info("{} has only a metadata file, so it's being deleted", directory.getAbsolutePath());
7070
}

0 commit comments

Comments
 (0)