mirror of https://github.com/apache/poi.git
XSLF - fixed NPE when adding pictures with existing non-picture media files (e.g. movies)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1728737 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ad696c04cb
commit
f2a8846bd4
|
@ -163,7 +163,13 @@ public final class XSLFPictureData extends POIXMLDocumentPart implements Picture
|
|||
byte data[] = getData();
|
||||
checksum = IOUtils.calculateChecksum(data);
|
||||
|
||||
switch (getType()) {
|
||||
PictureType pt = getType();
|
||||
if (pt == null) {
|
||||
origSize = new Dimension(1,1);
|
||||
return;
|
||||
}
|
||||
|
||||
switch (pt) {
|
||||
case EMF:
|
||||
origSize = new EMF.NativeHeader(data, 0).getSize();
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue