From 6c629908783ae3ef474f2c396abfd239e2d55774 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 13 Aug 2010 11:24:52 -0600 Subject: [PATCH] MOBI Output: When processing an input document that specifies non-existant files in the OPF guide, don't crash. Fixes #6490 (Unable to convert epub to Mobi in Calibre) --- src/calibre/ebooks/mobi/writer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/mobi/writer.py b/src/calibre/ebooks/mobi/writer.py index ca5256b430..10f1ee32d6 100644 --- a/src/calibre/ebooks/mobi/writer.py +++ b/src/calibre/ebooks/mobi/writer.py @@ -185,7 +185,7 @@ class Serializer(object): buffer.write('') for ref in self.oeb.guide.values(): path = urldefrag(ref.href)[0] - if hrefs[path].media_type not in OEB_DOCS: + if path not in hrefs or hrefs[path].media_type not in OEB_DOCS: continue buffer.write('