From: PJ Fanning Date: Mon, 30 Jul 2018 01:45:29 +0000 (+0000) Subject: add null guard in XSSFComment X-Git-Tag: REL_4_0_0_FINAL~60 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ad14771ed871c21038779ee4829e6520f24207bf;p=poi.git add null guard in XSSFComment git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1837012 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFComment.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFComment.java index 3a272a0677..14ca5d6495 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFComment.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFComment.java @@ -109,7 +109,7 @@ public class XSSFComment implements Comment { @Override public boolean isVisible() { boolean visible = false; - if(_vmlShape != null){ + if(_vmlShape != null) { String style = _vmlShape.getStyle(); visible = style != null && style.contains("visibility:visible"); } @@ -217,6 +217,9 @@ public class XSSFComment implements Comment { @Override public ClientAnchor getClientAnchor() { + if(_vmlShape == null) { + return null; + } String position = _vmlShape.getClientDataArray(0).getAnchorArray(0); int[] pos = new int[8]; int i = 0;