From: PJ Fanning Date: Sat, 12 Oct 2019 07:19:42 +0000 (+0000) Subject: add null check X-Git-Tag: REL_4_1_1~12 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1f6a3c99aeedc60647b8aefcc6d2ee42e9b44bbf;p=poi.git add null check git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1868317 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShape.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShape.java index 3711fdfc1a..3d4b9cff21 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShape.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShape.java @@ -472,7 +472,7 @@ public abstract class XSLFShape implements Shape { @Override public FlipMode getFlipMode() { CTTileInfoProperties tile = blipFill.getTile(); - switch (tile == null ? STTileFlipMode.INT_NONE : tile.getFlip().intValue()) { + switch (tile == null || tile.getFlip() == null ? STTileFlipMode.INT_NONE : tile.getFlip().intValue()) { default: case STTileFlipMode.INT_NONE: return FlipMode.NONE; diff --git a/src/ooxml/testcases/org/apache/poi/ooxml/TestPOIXMLProperties.java b/src/ooxml/testcases/org/apache/poi/ooxml/TestPOIXMLProperties.java index 459ba812e4..ba0acca5c8 100644 --- a/src/ooxml/testcases/org/apache/poi/ooxml/TestPOIXMLProperties.java +++ b/src/ooxml/testcases/org/apache/poi/ooxml/TestPOIXMLProperties.java @@ -308,7 +308,7 @@ public final class TestPOIXMLProperties { } private static String zeroPad(long i) { - if (i >= 0 && i <=9) { + if (i >= 0 && i <= 9) { return "0" + i; } else { return String.valueOf(i);