Skip to content

Commit 9c2da88

Browse files
committed
PDFBOX-5660: add check, as suggested by Valery Bokov; closes #231
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1928112 13f79535-47bb-0310-9956-ffa450edef68
1 parent 7a438df commit 9c2da88

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

pdfbox/src/main/java/org/apache/pdfbox/multipdf/Splitter.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,14 +657,18 @@ public void setStartPage(int start)
657657
* This will set the end page.
658658
*
659659
* @param end the 1-based end page
660-
* @throws IllegalArgumentException if the end page is smaller than one.
660+
* @throws IllegalArgumentException if the end page is smaller than one or than the start page.
661661
*/
662662
public void setEndPage(int end)
663663
{
664664
if(end <= 0)
665665
{
666666
throw new IllegalArgumentException("End page is smaller than one");
667667
}
668+
if (end < startPage)
669+
{
670+
throw new IllegalArgumentException("End page is smaller than startPage");
671+
}
668672
endPage = end;
669673
}
670674

0 commit comments

Comments
 (0)