Browse Source

修改合并异常

developing
Jiaju Zhuang 3 years ago
parent
commit
041b25abe6
  1. 7
      src/main/java/com/alibaba/excel/context/WriteContextImpl.java

7
src/main/java/com/alibaba/excel/context/WriteContextImpl.java

@ -179,9 +179,12 @@ public class WriteContextImpl implements WriteContext {
writeSheetHolder
.setCachedSheet(writeWorkbookHolder.getCachedWorkbook().getSheet(writeSheetHolder.getSheetName()));
}
} catch (Exception e) {
LOGGER.error("initSheet exception ",e);
} catch (IllegalArgumentException e) {
if (e.getMessage() != null && e.getMessage().contains(NO_SHEETS)) {
currentSheet = createSheet();
} else {
throw e;
}
}
if (currentSheet == null) {
currentSheet = createSheet();

Loading…
Cancel
Save