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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to