From b1e12aa4185a00a113626b9d0113cd2c055919ae Mon Sep 17 00:00:00 2001 From: zhouqinglai Date: Thu, 24 Oct 2019 13:07:34 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20=E8=A7=A3=E5=86=B3=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E7=9A=84=E7=A9=BA=E6=8C=87=E9=92=88=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/alibaba/excel/context/WriteContextImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/alibaba/excel/context/WriteContextImpl.java b/src/main/java/com/alibaba/excel/context/WriteContextImpl.java index f136ea0..6e691fd 100644 --- a/src/main/java/com/alibaba/excel/context/WriteContextImpl.java +++ b/src/main/java/com/alibaba/excel/context/WriteContextImpl.java @@ -429,7 +429,9 @@ public class WriteContextImpl implements WriteContext { OutputStream outputStream = encryptor.getDataStream(fileSystem); opcPackage.save(outputStream); } finally { - opcPackage.close(); + if (opcPackage != null) { + opcPackage.close(); + } } return fileSystem; }