]> source.dussan.org Git - poi.git/commitdiff
[bug-64477] prevent duplicate call to delete temporary file (SXSSF finalizer)
authorPJ Fanning <fanningpj@apache.org>
Thu, 28 May 2020 09:25:15 +0000 (09:25 +0000)
committerPJ Fanning <fanningpj@apache.org>
Thu, 28 May 2020 09:25:15 +0000 (09:25 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1878227 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/java/org/apache/poi/xssf/streaming/SheetDataWriter.java

index 8e98f7eaf2ee94923b746d0628c6c6a0b7d27942..cbac3b8822dca53ff3f192711e5f0e569718104b 100644 (file)
@@ -180,7 +180,7 @@ public class SheetDataWriter implements Closeable {
 
     @Override
     protected void finalize() throws Throwable {
-        if (!_fd.delete()) {
+        if (_fd.exists() && !_fd.delete()) {
             logger.log(POILogger.ERROR, "Can't delete temporary encryption file: "+_fd);
         }