From 1f6a3c99aeedc60647b8aefcc6d2ee42e9b44bbf Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Sat, 12 Oct 2019 07:19:42 +0000 Subject: [PATCH] add null check git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1868317 13f79535-47bb-0310-9956-ffa450edef68 --- src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShape.java | 2 +- .../testcases/org/apache/poi/ooxml/TestPOIXMLProperties.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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); -- 2.39.5