[alibaba/easyexcel]NullPointerException异常

2024-05-11 179 views
9

触发场景描述 excelWriter.fill 调用触发空指针异常 版本3.0.1

触发Bug的代码 StyleUtil类192行

image
Caused by: java.lang.NullPointerException: null
        at com.alibaba.excel.util.StyleUtil.createFont(StyleUtil.java:192)
        at com.alibaba.excel.util.StyleUtil.buildFont(StyleUtil.java:144)
        at com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder.createFont(WriteWorkbookHolder.java:304)
        at com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder.createCellStyle(WriteWorkbookHolder.java:286)
        at com.alibaba.excel.write.handler.impl.FillStyleCellWriteHandler.afterCellDispose(FillStyleCellWriteHandler.java:45)
        at com.alibaba.excel.util.WriteHandlerUtils.afterCellDispose(WriteHandlerUtils.java:193)
        at com.alibaba.excel.util.WriteHandlerUtils.afterCellDispose(WriteHandlerUtils.java:174)
        at com.alibaba.excel.write.executor.ExcelWriteFillExecutor.doFill(ExcelWriteFillExecutor.java:216)
        at com.alibaba.excel.write.executor.ExcelWriteFillExecutor.fill(ExcelWriteFillExecutor.java:119)
        at com.alibaba.excel.write.ExcelBuilderImpl.fill(ExcelBuilderImpl.java:82)
        at com.alibaba.excel.ExcelWriter.fill(ExcelWriter.java:110)
        at com.alibaba.excel.ExcelWriter.fill(ExcelWriter.java:98)

提示的异常或者没有达到的效果 本地进行修改后,NPE问题消失。

回答

5

有没有全部异常 这个没法排查

6

有没有全部异常 这个没法排查

已经补充异常。

1

升级成3.0.2试试

6

升级成3.0.2试试

已解决