diff --git a/iped-engine/src/main/java/iped/engine/io/ZIPInputStreamFactory.java b/iped-engine/src/main/java/iped/engine/io/ZIPInputStreamFactory.java index e3cab0b74c..0447f0100d 100644 --- a/iped-engine/src/main/java/iped/engine/io/ZIPInputStreamFactory.java +++ b/iped-engine/src/main/java/iped/engine/io/ZIPInputStreamFactory.java @@ -9,6 +9,7 @@ import java.nio.channels.ClosedChannelException; import java.nio.channels.SeekableByteChannel; import java.nio.file.Files; +import java.nio.file.NoSuchFileException; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; @@ -159,7 +160,12 @@ public SeekableInputStream getSeekableInputStream(String path) throws IOExceptio synchronized (filesCache) { tmp = filesCache.get(path); if (tmp != null) { - return new SeekableFileInputStream(tmp.toFile()); + try { + return new SeekableFileInputStream(tmp.toFile()); + } catch (NoSuchFileException e) { + // Could have been deleted by Item.dispose() + filesCache.remove(path); + } } }