Skip to content

Commit

Permalink
Address 4043
Browse files Browse the repository at this point in the history
When duplicating a page without /Contents objects, make sure to detect this situation.
  • Loading branch information
JorjMcKie committed Nov 12, 2024
1 parent bca7436 commit be1fa5f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4373,7 +4373,7 @@ def fullcopy_page(self, pno, to=-1):
res = JM_read_contents( page1)

# create new /Contents object for page2
if res.m_internal:
if res and res.m_internal:
#contents = mupdf.pdf_add_stream( pdf, mupdf.fz_new_buffer_from_copied_data( b" ", 1), NULL, 0)
contents = mupdf.pdf_add_stream( pdf, mupdf.fz_new_buffer_from_copied_data( b" "), mupdf.PdfObj(), 0)
JM_update_stream( pdf, contents, res, 1)
Expand Down

0 comments on commit be1fa5f

Please sign in to comment.