Skip to content

Commit be5d408

Browse files
committed
修复导出自定义类型空指针问题
1 parent 76853a2 commit be5d408

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

ExcelReads.jar

13.3 MB
Binary file not shown.

src/main/java/seven/savewapper/wapperRef/sysWppers/ResExprotObj.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ public void Save() throws Exception {
8282
cell.setCellValue(title[i]);
8383
}
8484
int index = 0;
85+
Object object=null;
8586
for (Object o : list) {
8687
//过滤行
8788
if (!filter.filter(o)) {
@@ -92,7 +93,8 @@ public void Save() throws Exception {
9293
for (int i = 0; i < title.length; i++) {
9394
Cell cell = row.createCell(i);
9495
cell.setCellStyle(style);
95-
cell.setCellValue(fields[i].get(o).toString());
96+
object=fields[i].get(o);
97+
cell.setCellValue(object==null?"":object.toString());
9698
}
9799
}
98100

0 commit comments

Comments
 (0)