diff options
author | Andreas Beeker <kiwiwings@apache.org> | 2017-02-14 00:18:13 +0000 |
---|---|---|
committer | Andreas Beeker <kiwiwings@apache.org> | 2017-02-14 00:18:13 +0000 |
commit | a7e78a3ca3109a3704062e5e9fa56159d4f03e24 (patch) | |
tree | ec8168f455315f3d934a1508ab587ad9b28c632e /src | |
parent | 99390a57593cb2bdc1efdb0299a147546e11d152 (diff) | |
download | poi-a7e78a3ca3109a3704062e5e9fa56159d4f03e24.tar.gz poi-a7e78a3ca3109a3704062e5e9fa56159d4f03e24.zip |
Metro shapes: integration test regression on empty paragraphs
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1782897 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r-- | src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextRun.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextRun.java b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextRun.java index 540c92eb2e..0d887a4120 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextRun.java +++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextRun.java @@ -18,6 +18,7 @@ package org.apache.poi.hslf.usermodel; import java.awt.Color; +import java.util.List; import org.apache.poi.hslf.exceptions.HSLFException; import org.apache.poi.hslf.model.textproperties.BitMaskTextProp; @@ -445,11 +446,14 @@ public final class HSLFTextRun implements TextRun { if (ts.getSheet() instanceof MasterSheet) { TextShape<?,? extends TextParagraph<?,?,? extends TextRun>> ms = ts.getMetroShape(); - if (ms == null) { + if (ms == null || ms.getTextParagraphs().isEmpty()) { return null; } - TextRun tr = ms.getTextParagraphs().get(0).getTextRuns().get(0); - return tr.getFieldType(); + List<? extends TextRun> trList = ms.getTextParagraphs().get(0).getTextRuns(); + if (trList.isEmpty()) { + return null; + } + return trList.get(0).getFieldType(); } return null; |