mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
EPUB Input: Handle invalid EPUB files that have their NCX documents in the spine. Fixes #1796497 [AttributeError: 'NoneType' object has no attribute 'get'](https://bugs.launchpad.net/calibre/+bug/1796497)
This commit is contained in:
parent
a616a092b2
commit
dc636725fa
@ -337,7 +337,7 @@ class OEBReader(object):
|
||||
self.logger.warn(u'Spine item %r not found' % idref)
|
||||
continue
|
||||
item = manifest.ids[idref]
|
||||
if item.media_type.lower() in OEB_DOCS and hasattr(item.data, 'xpath'):
|
||||
if item.media_type.lower() in OEB_DOCS and hasattr(item.data, 'xpath') and not getattr(item.data, 'tag', '').endswith('}ncx'):
|
||||
spine.add(item, elem.get('linear'))
|
||||
else:
|
||||
if hasattr(item.data, 'tag') and item.data.tag and item.data.tag.endswith('}html'):
|
||||
|
Loading…
x
Reference in New Issue
Block a user