Skip to content

Commit c9e3569

Browse files
JorjMcKiejulian-smith-artifex-com
authored andcommitted
Prevent working with empty document
1 parent 92ca9f4 commit c9e3569

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5281,6 +5281,8 @@ def pages(self, start: OptInt =None, stop: OptInt =None, step: OptInt =None) ->
52815281

52825282
Arguments have the same meaning as for the range() built-in.
52835283
"""
5284+
if not self.page_count:
5285+
raise ValueError("document has no pages")
52845286
# set the start value
52855287
start = start or 0
52865288
while start < 0:

0 commit comments

Comments
 (0)