修复 Unzipper 解压空 zip 文件时抛出异常的问题 (#5267)

This commit is contained in:
Glavo
2026-01-21 22:07:06 +08:00
committed by GitHub
parent 7ab22b0e07
commit 6d8add6d54

View File

@@ -152,7 +152,7 @@ public final class Unzipper {
} }
} }
if (entryCount == 0 && !terminateIfSubDirectoryNotExists) { if (entryCount == 0 && !"/".equals(subDirectory) && !terminateIfSubDirectoryNotExists) {
throw new NoSuchFileException("Subdirectory " + subDirectory + " does not exist in the zip file."); throw new NoSuchFileException("Subdirectory " + subDirectory + " does not exist in the zip file.");
} }
} }