mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
修复ExcelPicUtil
中可能的空指针异常
This commit is contained in:
@@ -99,7 +99,12 @@ public class ExcelPicUtil {
|
||||
for (XSSFShape shape : shapes) {
|
||||
if(shape instanceof XSSFPicture){
|
||||
pic = (XSSFPicture) shape;
|
||||
ctMarker = pic.getPreferredSize().getFrom();
|
||||
try{
|
||||
ctMarker = pic.getPreferredSize().getFrom();
|
||||
}catch (Exception e){
|
||||
// 此处可能有空指针异常,跳过之
|
||||
continue;
|
||||
}
|
||||
sheetIndexPicMap.put(StrUtil.format("{}_{}", ctMarker.getRow(), ctMarker.getCol()), pic.getPictureData());
|
||||
}
|
||||
// 其他类似于图表等忽略,see: https://gitee.com/chinabugotech/hutool/issues/I38857
|
||||
|
Reference in New Issue
Block a user