aboutsummaryrefslogtreecommitdiff
path: root/mammoth
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2025-05-28 19:56:36 +0100
committerMichael Williamson <mike@zwobble.org>2025-05-28 19:56:36 +0100
commite7041cb3e4188c24ca6efbd383df183518d7840d (patch)
treef54154b2853ff55825396ac8c39da2fc2a93d313 /mammoth
parenta095ca26ed2a0a5394ecd43e927a063b9a30542b (diff)
Ignore AlternateContent elements when there is no Fallback element
Diffstat (limited to 'mammoth')
-rw-r--r--mammoth/docx/body_xml.py2
1 files changed, 1 insertions, 1 deletions
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")