Fix exception in case of OPF with no <dc:title/>.

This commit is contained in:
Marshall T. Vandegrift 2009-01-30 18:18:46 -05:00
parent 00820d24f4
commit e4387cf308

View File

@ -1003,7 +1003,10 @@ def merge_metadata(htmlfile, opf, opts):
mi.cover = os.path.abspath(cover)
if not mi.title:
mi.title = os.path.splitext(os.path.basename(htmlfile))[0]
if htmlfile:
mi.title = os.path.splitext(os.path.basename(htmlfile))[0]
else:
mi.title = _('Unknown')
if not mi.authors:
mi.authors = [_('Unknown')]
return mi