From e4387cf30819ed9b174e71359dc1919aa7872624 Mon Sep 17 00:00:00 2001 From: "Marshall T. Vandegrift" Date: Fri, 30 Jan 2009 18:18:46 -0500 Subject: [PATCH] Fix exception in case of OPF with no . --- src/calibre/ebooks/html.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/html.py b/src/calibre/ebooks/html.py index bb7081658e..c78c45e42e 100644 --- a/src/calibre/ebooks/html.py +++ b/src/calibre/ebooks/html.py @@ -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