]> source.dussan.org Git - poi.git/commitdiff
[bug-62800] Fix null pointer exception if a picture shape has no blip id
authorPJ Fanning <fanningpj@apache.org>
Thu, 4 Oct 2018 07:47:27 +0000 (07:47 +0000)
committerPJ Fanning <fanningpj@apache.org>
Thu, 4 Oct 2018 07:47:27 +0000 (07:47 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1842782 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSheet.java

index cee875a8319c2b09ea9f7550e3b9beac5a102bae..b67264ba0f1fd62fc5d849531b7aaeb8a8e9eea2 100644 (file)
@@ -701,7 +701,8 @@ implements XSLFShapeContainer, Sheet<XSLFShape,XSLFTextParagraph> {
         for (XSLFShape shape : pictureShape.getSheet().getShapes()) {
             if (shape instanceof XSLFPictureShape) {
                 XSLFPictureShape currentPictureShape = ((XSLFPictureShape) shape);
-                if (currentPictureShape.getBlipId().equals(targetBlipId)) {
+                String currentBlipId = currentPictureShape.getBlipId();
+                if (currentBlipId != null && currentBlipId.equals(targetBlipId)) {
                     numberOfRelations++;
                 }
             }