From 25b5a61e68997d7575423703247abec19ca8f7da Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 24 Oct 2011 22:11:40 +0530 Subject: [PATCH] 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') --- src/calibre/ebooks/fb2/input.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/fb2/input.py b/src/calibre/ebooks/fb2/input.py index 3c62b9671d..147e940eb4 100644 --- a/src/calibre/ebooks/fb2/input.py +++ b/src/calibre/ebooks/fb2/input.py @@ -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()