Browse Source

修改异常样式的情况下不会空指针

pull/2533/head
Jiaju Zhuang 3 years ago
parent
commit
0b4e334044
  1. 3
      easyexcel-core/src/main/java/com/alibaba/excel/read/metadata/holder/xlsx/XlsxReadWorkbookHolder.java

3
easyexcel-core/src/main/java/com/alibaba/excel/read/metadata/holder/xlsx/XlsxReadWorkbookHolder.java

@ -65,6 +65,9 @@ public class XlsxReadWorkbookHolder extends ReadWorkbookHolder {
return null; return null;
} }
XSSFCellStyle xssfCellStyle = stylesTable.getStyleAt(dateFormatIndexInteger); XSSFCellStyle xssfCellStyle = stylesTable.getStyleAt(dateFormatIndexInteger);
if (xssfCellStyle == null) {
return null;
}
dataFormatData.setIndex(xssfCellStyle.getDataFormat()); dataFormatData.setIndex(xssfCellStyle.getDataFormat());
dataFormatData.setFormat(BuiltinFormats.getBuiltinFormat(dataFormatData.getIndex(), dataFormatData.setFormat(BuiltinFormats.getBuiltinFormat(dataFormatData.getIndex(),
xssfCellStyle.getDataFormatString(), globalConfiguration().getLocale())); xssfCellStyle.getDataFormatString(), globalConfiguration().getLocale()));

Loading…
Cancel
Save