]> source.dussan.org Git - poi.git/commitdiff
Fix bug #52665 - When reading from a ZipFileZipEntrySource that has already been...
authorNick Burch <nick@apache.org>
Wed, 15 Feb 2012 11:51:06 +0000 (11:51 +0000)
committerNick Burch <nick@apache.org>
Wed, 15 Feb 2012 11:51:06 +0000 (11:51 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1244450 13f79535-47bb-0310-9956-ffa450edef68

src/documentation/content/xdocs/status.xml
src/ooxml/java/org/apache/poi/openxml4j/util/ZipFileZipEntrySource.java

index 665a6cb18b4360086af4bf38e09366f58a3290e1..31402b1482a83041d5de1d259ae95063423021d5 100644 (file)
@@ -34,6 +34,7 @@
 
     <changes>
         <release version="3.8-beta6" date="2012-??-??">
+           <action dev="poi-developers" type="fix">52665 - When reading from a ZipFileZipEntrySource that has already been closed, give IllegalArgumentException rather than NPE</action>
            <action dev="poi-developers" type="fix">52664 - MAPIMessage may not always have name chunks when checking for 7 bit encodings</action>
            <action dev="poi-developers" type="fix">52649 - fixed namespace issue in WordToFoConverter</action>
            <action dev="poi-developers" type="fix">52385 - avoid trancated array and vector data when reading OLE properties</action>
index 5c2b7b35e4e6b57ae55007a1d698726e9dc4e8b9..f4117f44bfa9dae91c59a99f265848fcd94536c5 100644 (file)
@@ -41,10 +41,16 @@ public class ZipFileZipEntrySource implements ZipEntrySource {
    }
 
    public Enumeration<? extends ZipEntry> 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);
    }
 }