aboutsummaryrefslogtreecommitdiffstats
path: root/src/ooxml/java
diff options
context:
space:
mode:
authorDominik Stadler <centic@apache.org>2019-03-02 12:28:19 +0000
committerDominik Stadler <centic@apache.org>2019-03-02 12:28:19 +0000
commita9b2a8b2bd6e93ba85984be9a2aa8f9ac991c968 (patch)
tree20d3e5befc91d841ec77c54e09496e845d0c43a9 /src/ooxml/java
parent53a30d796e27cf44eff2fdecf173b42e89430f61 (diff)
downloadpoi-a9b2a8b2bd6e93ba85984be9a2aa8f9ac991c968.tar.gz
poi-a9b2a8b2bd6e93ba85984be9a2aa8f9ac991c968.zip
Bug 63200: Avoid NullPointerException in XSLFShape.selectPaint() and check some more in integration tests
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1854639 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ooxml/java')
-rw-r--r--src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFGradientFillProperties.java2
-rw-r--r--src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShape.java3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFGradientFillProperties.java b/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFGradientFillProperties.java
index c46a58bb29..ab05448eec 100644
--- a/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFGradientFillProperties.java
+++ b/src/ooxml/java/org/apache/poi/xddf/usermodel/XDDFGradientFillProperties.java
@@ -112,7 +112,7 @@ public class XDDFGradientFillProperties implements XDDFFillProperties {
.getGsLst()
.getGsList()
.stream()
- .map(gs -> new XDDFGradientStop(gs))
+ .map(XDDFGradientStop::new)
.collect(Collectors.toList()));
} else {
return Collections.emptyList();
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 a11b62abb3..3df55edbaa 100644
--- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShape.java
+++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShape.java
@@ -431,7 +431,8 @@ public abstract class XSLFShape implements Shape<XSLFShape,XSLFTextParagraph> {
protected static PaintStyle selectPaint(final CTGradientFillProperties gradFill, CTSchemeColor phClr, final XSLFTheme theme) {
@SuppressWarnings("deprecation")
- final CTGradientStop[] gs = gradFill.getGsLst().getGsArray();
+ final CTGradientStop[] gs = gradFill.getGsLst() == null ?
+ new CTGradientStop[0] : gradFill.getGsLst().getGsArray();
Arrays.sort(gs, (o1, o2) -> {
int pos1 = o1.getPos();