lyhzzz 2 miesięcy temu
rodzic
commit
233db5ae62

+ 1 - 1
src/main/java/com/fdkankan/agent/util/ExcelUtil.java

@@ -43,7 +43,7 @@ public class ExcelUtil {
 
                 if (cell != null && cell.getCellTypeEnum() != CellType.STRING && HSSFDateUtil.isCellDateFormatted(cell)) {
                     Date date = cell.getDateCellValue();
-                    if (HSSFDateUtil.isValidExcelDate(date.getTime())) {
+                    if (date != null && HSSFDateUtil.isValidExcelDate(date.getTime())) {
                         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                         String value = sdf.format(date);
                         map.put(cellNum,value);