mirror of https://github.com/apache/poi.git
avoid nulls in HSSFWorkbook.getAllPictures when EscherBlipRecord is not found
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1025635 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
877982ea92
commit
69cfa15160
|
@ -1594,8 +1594,6 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss
|
|||
// TODO: Some kind of structure.
|
||||
HSSFPictureData picture = new HSSFPictureData(blip);
|
||||
pictures.add(picture);
|
||||
} else {
|
||||
pictures.add(null);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -71,4 +71,16 @@ public final class TestHSSFPictureData extends TestCase{
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void testNotNullPictures() throws IOException {
|
||||
|
||||
HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("SheetWithDrawing.xls");
|
||||
|
||||
@SuppressWarnings("unchecked") // TODO - add getFormat() to interface PictureData and genericise wb.getAllPictures()
|
||||
List<HSSFPictureData> lst = (List<HSSFPictureData>)(List<?>)wb.getAllPictures();
|
||||
for(HSSFPictureData pict : lst){
|
||||
assertNotNull(pict);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue