Skip to content

Commit 052f8ac

Browse files
authored
BUG: Check for AcroForm and ensure it is not None (#1965)
1 parent 1bec5a3 commit 052f8ac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pypdf/_writer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2921,7 +2921,7 @@ def merge(
29212921
pag[NameObject("/Annots")] = lst
29222922
self.clean_page(pag)
29232923

2924-
if "/AcroForm" in cast(DictionaryObject, reader.trailer["/Root"]):
2924+
if "/AcroForm" in _ro and _ro['/AcroForm'] is not None:
29252925
if "/AcroForm" not in self._root_object:
29262926
self._root_object[NameObject("/AcroForm")] = self._add_object(
29272927
cast(

0 commit comments

Comments
 (0)