GP-5938 fix NPE when extracting bz2

This commit is contained in:
dev747368 2025-09-02 20:13:55 +00:00
parent eef9950870
commit 2a1df77713

View file

@ -401,8 +401,9 @@ public class SevenZipFileSystem extends AbstractFileSystem<ISimpleInArchiveItem>
// In our case, we only handle extract operations.
if (!currentItem.isFolder() && extractAskMode == ExtractAskMode.EXTRACT) {
try {
currentCacheEntryBuilder = fsService.createTempFile(currentItem.getSize());
monitor.initialize(currentItem.getSize(), "Extracting " + currentName);
long size = Objects.requireNonNullElse(currentItem.getSize(), -1L);
currentCacheEntryBuilder = fsService.createTempFile(size);
monitor.initialize(size, "Extracting " + currentName);
}
catch (IOException e) {
throw new SevenZipException(e);