File tree Expand file tree Collapse file tree 4 files changed +17
-1
lines changed Expand file tree Collapse file tree 4 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ history and [GitHub's 'Contributors' feature](https://github.com/py-pdf/pypdf/gr
3939* [ Mérino, Antoine] ( https://github.com/Merinorus )
4040* [ Murphy, Kevin] ( https://github.com/kmurphy4 )
4141* [ nalin-udhaar] ( https://github.com/nalin-udhaar )
42+ * [ Noah-Houghton] ( https://github.com/Noah-Houghton ) | [ LinkedIn] ( https://www.linkedin.com/in/noah-h-554992a0/ )
4243* [ Paramonov, Alexey] ( https://github.com/alexey-v-paramonov )
4344* [ Paternault, Louis] ( https://framagit.org/spalax )
4445* [ Perrensen, Olsen] ( https://github.com/olsonperrensen )
Original file line number Diff line number Diff line change @@ -3003,7 +3003,10 @@ def add_filtered_articles(
30033003 for p in pages .values ():
30043004 pp = p .original_page
30053005 for a in pp .get ("/B" , ()):
3006- thr = a .get_object ().get ("/T" )
3006+ a_obj = a .get_object ()
3007+ if is_null_or_none (a_obj ):
3008+ continue
3009+ thr = a_obj .get ("/T" )
30073010 if thr is None :
30083011 continue
30093012 thr = thr .get_object ()
Original file line number Diff line number Diff line change 120120 url : https://github.com/user-attachments/files/21578875/layout-parser-paper-with-empty-pages.pdf
121121- local_filename : issue-3429.pdf
122122 url : https://github.com/user-attachments/files/21711469/bomb.pdf
123+ - local_filename : issue-3508.pdf
124+ url : https://github.com/user-attachments/files/23211824/repair-manual-thermo-230-300-350-2012-en.pdf
Original file line number Diff line number Diff line change 1010from pypdf .generic import Destination , Fit
1111
1212from . import get_data_from_url
13+ from .test_encryption import HAS_AES
1314
1415TESTS_ROOT = Path (__file__ ).parent .resolve ()
1516PROJECT_ROOT = TESTS_ROOT .parent
@@ -399,6 +400,15 @@ def test_articles_with_writer(caplog):
399400 assert r .threads [0 ].get_object ()["/F" ]["/P" ] == r .pages [0 ]
400401
401402
403+ @pytest .mark .skipif (not HAS_AES , reason = "No AES implementation" )
404+ @pytest .mark .enable_socket
405+ def test_null_articles_with_writer ():
406+ data = get_data_from_url (name = "issue-3508.pdf" )
407+ merger = PdfWriter ()
408+ merger .append (BytesIO (data ))
409+ assert len (merger .pages ) == 98
410+
411+
402412def test_get_reference ():
403413 writer = PdfWriter (RESOURCE_ROOT / "crazyones.pdf" )
404414 assert writer .get_reference (writer .pages [0 ]) == writer .pages [0 ].indirect_reference
You can’t perform that action at this time.
0 commit comments