Prevent lxml from attempting to parse None

This commit is contained in:
Aaron Rhodes 2020-03-30 17:50:07 -04:00
parent 4fe1cc507d
commit a7c5531f20

View File

@ -236,7 +236,7 @@ class DocxTemplate(object):
def get_headers_footers_xml(self, uri):
for relKey, val in self.docx._part._rels.items():
if val.reltype == uri:
if (val.reltype == uri) and (val._target._blob):
yield relKey, self.xml_to_string(parse_xml(val._target._blob))
def get_headers_footers_encoding(self,xml):