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); }