From be1fa5f19e4befb448438d6683e556c86c0b4cd3 Mon Sep 17 00:00:00 2001 From: "Jorj X. McKie" Date: Tue, 12 Nov 2024 09:59:26 -0400 Subject: [PATCH] Address 4043 When duplicating a page without /Contents objects, make sure to detect this situation. --- src/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/__init__.py b/src/__init__.py index b94a01024..b71b10fad 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -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)