From 5114792fce145e757d2a85f17ce4b0ee5fda951e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 9 Apr 2010 10:10:54 +0530 Subject: [PATCH] Fix #5234 (Crash during EPUB to MOBI conversion (Kindle 2)) --- src/calibre/ebooks/oeb/reader.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/calibre/ebooks/oeb/reader.py b/src/calibre/ebooks/oeb/reader.py index e829891a45..ebe6e78d08 100644 --- a/src/calibre/ebooks/oeb/reader.py +++ b/src/calibre/ebooks/oeb/reader.py @@ -470,6 +470,8 @@ class OEBReader(object): if item is None: return False ncx = item.data + if ncx is None: + return False ptargets = xpath(ncx, 'ncx:pageList/ncx:pageTarget') if not ptargets: return False