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)

This commit is contained in:
Kovid Goyal 2010-08-13 11:24:52 -06:00
parent 042f67b12e
commit 6c62990878

View File

@ -185,7 +185,7 @@ class Serializer(object):
buffer.write('<guide>')
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('<reference type="')