1. Florian Strzelecki
  2. epub
  3. Issues
Issue #3 resolved

_parse_xml_metadata should not choke on absent firstChild

medoc
created an issue

When an element has no firstChild, an exception is raised:

  ['NoneType' object has no attribute 'data']

The code should be fixed to look more like the following or an equivalent:

if node.firstChild:
    metadata.add_title(node.firstChild.data.strip(),
                       node.getAttribute(u'xml:lang'))

Comments (4)

  1. Log in to comment