Skip to content

Commit

Permalink
BUG: Use build_destination for named destination outlines (#1128)
Browse files Browse the repository at this point in the history
Closes #1121
  • Loading branch information
mtd91429 authored Jul 17, 2022
1 parent e24b0a0 commit 7fba86b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions PyPDF2/_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -834,8 +834,7 @@ def _build_outline(self, node: DictionaryObject) -> Optional[Destination]:
if isinstance(dest, ArrayObject):
outline = self._build_destination(title, dest) # type: ignore
elif isinstance(dest, str) and dest in self._namedDests:
outline = self._namedDests[dest]
outline[NameObject("/Title")] = title # type: ignore
outline = self._build_destination(title, self._namedDests[dest].dest_array) # type: ignore
else:
raise PdfReadError(f"Unexpected destination {dest!r}")

Expand Down

0 comments on commit 7fba86b

Please sign in to comment.