You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by fa...@apache.org on 2021/11/08 11:15:26 UTC

svn commit: r1894831 - /poi/trunk/poi-ooxml/src/main/java/org/apache/poi/openxml4j/util/ZipArchiveFakeEntry.java

Author: fanningpj
Date: Mon Nov  8 11:15:26 2021
New Revision: 1894831

URL: http://svn.apache.org/viewvc?rev=1894831&view=rev
Log:
return better error message when ZipEntry has no data (it was closed before the data was retrieved)

Modified:
    poi/trunk/poi-ooxml/src/main/java/org/apache/poi/openxml4j/util/ZipArchiveFakeEntry.java

Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/openxml4j/util/ZipArchiveFakeEntry.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/openxml4j/util/ZipArchiveFakeEntry.java?rev=1894831&r1=1894830&r2=1894831&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/openxml4j/util/ZipArchiveFakeEntry.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/openxml4j/util/ZipArchiveFakeEntry.java Mon Nov  8 11:15:26 2021
@@ -88,8 +88,10 @@ import org.apache.poi.util.TempFile;
             } catch (FileNotFoundException e) {
                 throw new RuntimeException("temp file " + tempFile.getAbsolutePath() + " is missing");
             }
-        } else {
+        } else if (data != null) {
             return new UnsynchronizedByteArrayInputStream(data);
+        } else {
+            throw new RuntimeException("Cannot retrieve data from Zip Entry, probably because the Zip Entry was closed before the data was requested.");
         }
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org