From: Jeremias Maerki Date: Wed, 23 Feb 2005 21:58:17 +0000 (+0000) Subject: Avoid IndexOutOfBoundsException when empty list is passed in. X-Git-Tag: Root_Temp_KnuthStylePageBreaking~51 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ce6b0bd2e4f97178ea4f3677daa565d4ae12d8a3;p=xmlgraphics-fop.git 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 --- 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; }