diff --git a/src/documentation/content/xdocs/status.xml b/src/documentation/content/xdocs/status.xml index 665a6cb18b..31402b1482 100644 --- a/src/documentation/content/xdocs/status.xml +++ b/src/documentation/content/xdocs/status.xml @@ -34,6 +34,7 @@ + 52665 - When reading from a ZipFileZipEntrySource that has already been closed, give IllegalArgumentException rather than NPE 52664 - MAPIMessage may not always have name chunks when checking for 7 bit encodings 52649 - fixed namespace issue in WordToFoConverter 52385 - avoid trancated array and vector data when reading OLE properties diff --git a/src/ooxml/java/org/apache/poi/openxml4j/util/ZipFileZipEntrySource.java b/src/ooxml/java/org/apache/poi/openxml4j/util/ZipFileZipEntrySource.java index 5c2b7b35e4..f4117f44bf 100644 --- a/src/ooxml/java/org/apache/poi/openxml4j/util/ZipFileZipEntrySource.java +++ b/src/ooxml/java/org/apache/poi/openxml4j/util/ZipFileZipEntrySource.java @@ -41,10 +41,16 @@ public class ZipFileZipEntrySource implements ZipEntrySource { } public Enumeration getEntries() { + if (zipArchive == null) + throw new IllegalStateException("Zip File is closed"); + return zipArchive.entries(); } public InputStream getInputStream(ZipEntry entry) throws IOException { + if (zipArchive == null) + throw new IllegalStateException("Zip File is closed"); + return zipArchive.getInputStream(entry); } }