]> source.dussan.org Git - poi.git/commitdiff
Avoid possible NullPointerException seen with some powerpoint files
authorDominik Stadler <centic@apache.org>
Mon, 20 Apr 2015 18:26:39 +0000 (18:26 +0000)
committerDominik Stadler <centic@apache.org>
Mon, 20 Apr 2015 18:26:39 +0000 (18:26 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1674958 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/java/org/apache/poi/xslf/usermodel/RenderableShape.java
test-data/slideshow/ae.ac.uaeu.faculty_nafaachbili_GeomLec1.pptx [new file with mode: 0644]

index 053ccd491dd6ca093bfa3609a78aa047941b5737..e3804413ac7c77ef762ad83b1326088ed5e32cbd 100644 (file)
@@ -576,7 +576,7 @@ class RenderableShape {
 \r
                 public Guide getAdjustValue(String name) {\r
                     CTPresetGeometry2D prst = _shape.getSpPr().getPrstGeom();\r
-                    if (prst.isSetAvLst()) {\r
+                    if (prst != null && prst.isSetAvLst()) {\r
                         for (CTGeomGuide g : prst.getAvLst().getGdArray()) {\r
                             if (g.getName().equals(name)) {\r
                                 return new Guide(g);\r
diff --git a/test-data/slideshow/ae.ac.uaeu.faculty_nafaachbili_GeomLec1.pptx b/test-data/slideshow/ae.ac.uaeu.faculty_nafaachbili_GeomLec1.pptx
new file mode 100644 (file)
index 0000000..ca9d791
Binary files /dev/null and b/test-data/slideshow/ae.ac.uaeu.faculty_nafaachbili_GeomLec1.pptx differ