when using POI to import data, it is found that sometimes, or some excel files, the import process will report a null pointer, and later found that the corresponding row of cells are caused by null. The
code is as follows: `public Map < String,Object > readExcel (MultipartFile file) {
Workbook workBook = null;
InputStream is = file.getInputStream();
try {
if(file.getOriginalFilename().endsWith("xls")){
workBook =new HSSFWorkbook(is);
}else if(file.getOriginalFilename().endsWith("xlsx")){
workBook =new XSSFWorkBook(is);
}
Sheet sheet1 = workBook.getSheetAt(0);
/**
* for
* excel
*/
Cell cell = sheet1.getRow(2).getCell(0);
//...
} catch (Exception e) {
}
}`