mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
FB2 Input: Dont choke on FB2 files that have empty embedded content tags. Fixes #880904 (can't view fb2 file - 'NoneType' object has no attribute 'strip')
This commit is contained in:
parent
5b600f708a
commit
25b5a61e68
@ -127,7 +127,7 @@ class FB2Input(InputFormatPlugin):
|
||||
def extract_embedded_content(self, doc):
|
||||
self.binary_map = {}
|
||||
for elem in doc.xpath('./*'):
|
||||
if 'binary' in elem.tag and elem.attrib.has_key('id'):
|
||||
if elem.text and 'binary' in elem.tag and elem.attrib.has_key('id'):
|
||||
ct = elem.get('content-type', '')
|
||||
fname = elem.attrib['id']
|
||||
ext = ct.rpartition('/')[-1].lower()
|
||||
|
Loading…
x
Reference in New Issue
Block a user