diff options
| author | Michael Williamson <mike@zwobble.org> | 2026-12-05 10:19:25 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2026-12-05 10:19:25 +0000 |
| commit | ae06a2bacfb74c88340e900e8a29336418936e9e (patch) | |
| tree | 57f48a831f4c34fc45c5a18994007d8713393819 /lib/docx | |
| parent | 5171a9072f8b7343ab1c9ed3a15d6d372cb59b67 (diff) | |
Handle XML documents that are missing a root element
Diffstat (limited to 'lib/docx')
| -rw-r--r-- | lib/docx/office-xml-reader.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/docx/office-xml-reader.js b/lib/docx/office-xml-reader.js index 792cd7c..6d2c1e9 100644 --- a/lib/docx/office-xml-reader.js +++ b/lib/docx/office-xml-reader.js @@ -38,7 +38,11 @@ var xmlNamespaceMap = { function read(xmlString) { return xml.readString(xmlString, xmlNamespaceMap) .then(function(document) { - return collapseAlternateContent(document)[0]; + if (document === null) { + return null; + } else { + return collapseAlternateContent(document)[0]; + } }); } |
