From 4cd8159bff58dc23916041a733523f5bd35e7ffb Mon Sep 17 00:00:00 2001 From: "Andreas L. Delmelle" Date: Sat, 11 Jul 2015 17:52:10 +0000 Subject: [PATCH] Preliminary quick fix for FOP-2461 git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1690396 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/fop/layoutmgr/list/ListItemLayoutManager.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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()); -- 2.39.5