From e7041cb3e4188c24ca6efbd383df183518d7840d Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Wed, 28 May 2025 19:56:36 +0100 Subject: Ignore AlternateContent elements when there is no Fallback element --- mammoth/docx/body_xml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mammoth') diff --git a/mammoth/docx/body_xml.py b/mammoth/docx/body_xml.py index cc4e9ad..40b5f9d 100644 --- a/mammoth/docx/body_xml.py +++ b/mammoth/docx/body_xml.py @@ -569,7 +569,7 @@ def _create_reader(numbering, content_types, relationships, styles, docx_file, f return _success(documents.comment_reference(element.attributes["w:id"])) def alternate_content(element): - return read_child_elements(element.find_child("mc:Fallback")) + return read_child_elements(element.find_child_or_null("mc:Fallback")) def read_sdt(element): checkbox = element.find_child_or_null("w:sdtPr").find_child("wordml:checkbox") -- cgit v1.2.3