From ce6b0bd2e4f97178ea4f3677daa565d4ae12d8a3 Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Wed, 23 Feb 2005 21:58:17 +0000 Subject: [PATCH] Avoid IndexOutOfBoundsException when empty list is passed in. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198456 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/layoutmgr/BreakPossPosIter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/java/org/apache/fop/layoutmgr/BreakPossPosIter.java b/src/java/org/apache/fop/layoutmgr/BreakPossPosIter.java index 40a1a4aae..5f37ee92c 100644 --- a/src/java/org/apache/fop/layoutmgr/BreakPossPosIter.java +++ b/src/java/org/apache/fop/layoutmgr/BreakPossPosIter.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2004 The Apache Software Foundation. + * Copyright 1999-2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,7 @@ public class BreakPossPosIter extends PositionIterator { * @param endPos ending position */ public BreakPossPosIter(List bpList, int startPos, int endPos) { - super(bpList.listIterator(startPos)); + super((bpList.size() > 0 ? bpList.listIterator(startPos) : bpList.listIterator())); iterCount = endPos - startPos; } -- 2.39.5