]> source.dussan.org Git - poi.git/commitdiff
Avoid NullPointerException if an image cannot be read
authorDominik Stadler <centic@apache.org>
Mon, 20 Apr 2015 18:10:43 +0000 (18:10 +0000)
committerDominik Stadler <centic@apache.org>
Mon, 20 Apr 2015 18:10:43 +0000 (18:10 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1674952 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFImageRenderer.java
test-data/slideshow/at.ecodesign.www_downloads_Vertiefungsvortrag_elektronik.pptx [new file with mode: 0644]

index 6e2633515aecbd65823d32068f8dc8ba7e8f7147..7153bc86a89be2a2c59cc8f6398fc6451cf32f8f 100644 (file)
@@ -99,6 +99,10 @@ public class XSLFImageRenderer {
         } catch (Exception e) {\r
             return false;\r
         }\r
+        \r
+        if(img == null) {\r
+               return false;\r
+        }\r
 \r
         int iw = img.getWidth();\r
                int ih = img.getHeight();\r
diff --git a/test-data/slideshow/at.ecodesign.www_downloads_Vertiefungsvortrag_elektronik.pptx b/test-data/slideshow/at.ecodesign.www_downloads_Vertiefungsvortrag_elektronik.pptx
new file mode 100644 (file)
index 0000000..0578862
Binary files /dev/null and b/test-data/slideshow/at.ecodesign.www_downloads_Vertiefungsvortrag_elektronik.pptx differ