From 01ad2f9d1a1c6a9f1c9f80190059559e0a2235c5 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Thu, 4 Oct 2018 07:47:27 +0000 Subject: [PATCH] [bug-62800] Fix null pointer exception if a picture shape has no blip id 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSheet.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSheet.java index cee875a83..b67264ba0 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSheet.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSheet.java @@ -701,7 +701,8 @@ implements XSLFShapeContainer, Sheet { 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++; } }