From: Andreas L. Delmelle Date: Sat, 11 Jul 2015 17:52:10 +0000 (+0000) Subject: Preliminary quick fix for FOP-2461 X-Git-Tag: fop-2_1~51 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4cd8159bff58dc23916041a733523f5bd35e7ffb;p=xmlgraphics-fop.git Preliminary quick fix for FOP-2461 git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1690396 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java b/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java index 16abdb527..46a93b3f5 100644 --- a/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java @@ -393,7 +393,8 @@ public class ListItemLayoutManager extends SpacedBorderedPaddedBlockLayoutManage int breakClass = EN_AUTO; KnuthElement endEl = elementLists[0].size() > 0 ? (KnuthElement) elementLists[0].get(end[0]) : null; - Position originalLabelPosition = endEl != null ? endEl.getPosition().getPosition() : null; + Position originalLabelPosition = + (endEl != null && endEl.getPosition() != null) ? endEl.getPosition().getPosition() : null; if (endEl instanceof KnuthPenalty) { additionalPenaltyHeight = endEl.getWidth(); stepPenalty = endEl.getPenalty() == -KnuthElement.INFINITE ? -KnuthElement.INFINITE : Math @@ -402,7 +403,8 @@ public class ListItemLayoutManager extends SpacedBorderedPaddedBlockLayoutManage ((KnuthPenalty) endEl).getBreakClass()); } endEl = elementLists[1].size() > 0 ? (KnuthElement) elementLists[1].get(end[1]) : null; - Position originalBodyPosition = endEl != null ? endEl.getPosition().getPosition() : null; + Position originalBodyPosition = + (endEl != null && endEl.getPosition() != null) ? endEl.getPosition().getPosition() : null; if (endEl instanceof KnuthPenalty) { additionalPenaltyHeight = Math.max( additionalPenaltyHeight, endEl.getWidth());