mirror of
https://github.com/Kozea/WeasyPrint.git
synced 2024-10-05 00:21:15 +03:00
Fix crash when there’s no outline
This commit is contained in:
parent
44c21b7f31
commit
7de2e45f55
@ -833,11 +833,12 @@ class Document:
|
||||
last_by_depth.append(children)
|
||||
|
||||
outlines, count = create_bookmarks(root, pdf)
|
||||
pdf.catalog['Outlines'] = pydyf.Dictionary({
|
||||
'Count': count,
|
||||
'First': outlines[0].reference,
|
||||
'Last': outlines[-1].reference,
|
||||
})
|
||||
if outlines:
|
||||
pdf.catalog['Outlines'] = pydyf.Dictionary({
|
||||
'Count': count,
|
||||
'First': outlines[0].reference,
|
||||
'Last': outlines[-1].reference,
|
||||
})
|
||||
|
||||
PROGRESS_LOGGER.info('Step 7 - Adding PDF metadata')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user