From 120dfbd62e585962ede924bdcb26449e2f969128 Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Wed, 4 Sep 2019 20:03:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9C=A8=E4=BC=A0=E5=85=A5Li?= =?UTF-8?q?st>=E5=88=A4=E6=96=AD=E8=A1=8C=E6=95=B0=E9=94=99?= =?UTF-8?q?=E8=AF=AF=20#526?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/alibaba/excel/write/ExcelBuilderImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/alibaba/excel/write/ExcelBuilderImpl.java b/src/main/java/com/alibaba/excel/write/ExcelBuilderImpl.java index 82a4119b..c03c8434 100644 --- a/src/main/java/com/alibaba/excel/write/ExcelBuilderImpl.java +++ b/src/main/java/com/alibaba/excel/write/ExcelBuilderImpl.java @@ -185,7 +185,8 @@ public class ExcelBuilderImpl implements ExcelBuilder { beforeCellCreate(row, head, relativeRowIndex); Cell cell = WorkBookUtil.createCell(row, cellIndex); Object value = oneRowData.get(dataIndex); - CellData cellData = converterAndSet(context.currentWriteHolder(), value.getClass(), cell, value, null); + CellData cellData = + converterAndSet(context.currentWriteHolder(), value == null ? null : value.getClass(), cell, value, null); afterCellCreate(head, cellData, cell, relativeRowIndex); }