EasyPoi 导出EXCEL后workbook 报空指针异常

EasyPoi 导出EXCEL后workbook 报空指针异常

private AjaxResult exportselecttransportAllExport(List list, HttpServletResponse response) throws IOException {

    // 总数据
    TemplateExportParams params = new TemplateExportParams(JDWLConfig.getProfile() + "/poi/n_transportAllReport.xlsx");
    Map<String, Object> map = new HashMap<>();
    map.put("exportselecttransportAllExportInfos", list);
    Workbook workbook = ExcelExportUtil.exportExcel(params, map);
    String filename = "单据汇总_"+ DateUtils.myGetTime() +".xlsx";
    File savefile = new File(FileUploadUtils.buildCommonDownloadFilePath(filename));
    FileOutputStream fos = new FileOutputStream(savefile);
    workbook.write(fos);
    fos.close();
    return AjaxResult.success(filename);

}
运行结果及报错内容

java.lang.NullPointerException: null

我的解答思路和尝试过的方法

可能是list中有部分数据为空值,tostring无法转换null导致,需要遍历存入map中的null用空字符串代替

我想要达到的结果

不会写替换list中null为空值的逻辑代码,求指点

你是使用指令还是注解的方式