Skip to content

Commit c1b0d48

Browse files
authored
Merge pull request #351 from transifex/dockx_fix
Fix for Docx parser
2 parents aa7e7f4 + 931360f commit c1b0d48

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

openformats/formats/office_open_xml/parser.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ def compile_paragraph(cls, paragraph, rels_soup, stringset, is_rtl=False):
249249
# the text parts of the translation are more that the
250250
# text parts of the document, so we will compress the
251251
# remaining translation parts into one string
252-
if len(translation_soup) > 0:
252+
if len(translation_soup) > 0 and last_element and last_element.contents:
253253
translation = last_element.contents[0] + \
254254
"".join([six.text_type(t) for t in translation_soup]
255255
)

0 commit comments

Comments
 (0)