Skip to content

Commit

Permalink
Merge pull request #1814 from openoereb/fix-1813-pdf_error
Browse files Browse the repository at this point in the history
fix error appearing in dev environment
  • Loading branch information
marionb authored Sep 11, 2023
2 parents 3d085ce + 389f924 commit 794eaa6
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,10 @@ def __call__(self, value, system):
pdf_reader = PdfReader(pdf)
x = []
for i in range(len(pdf_reader.outline)):
x.append(pdf_reader.outline[i]['/Page']['/StructParents'])
if isinstance(pdf_reader.outline[i], list):
x.append(pdf_reader.outline[i][0]['/Page']['/StructParents'])
else:
x.append(pdf_reader.outline[i]['/Page']['/StructParents'])
try:
true_nb_of_toc = min(x)-1
except ValueError:
Expand Down

0 comments on commit 794eaa6

Please sign in to comment.