From 3883efff054006f4983208ffdecca40278d22285 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 10 May 2017 22:43:24 +0530 Subject: [PATCH] Fix error when rendering book on server with empty spine --- src/calibre/ebooks/oeb/polish/cover.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/oeb/polish/cover.py b/src/calibre/ebooks/oeb/polish/cover.py index 6423765d6e..6b5a6321f0 100644 --- a/src/calibre/ebooks/oeb/polish/cover.py +++ b/src/calibre/ebooks/oeb/polish/cover.py @@ -435,7 +435,7 @@ def set_epub_cover(container, cover_path, report, options=None): # pages and handle possibly removing stylesheets referred to by them. spine_items = tuple(container.spine_items) - if cover_page is None: + if cover_page is None and spine_items: # Check if the first item in the spine is a simple cover wrapper candidate = container.abspath_to_name(spine_items[0]) if find_cover_image_in_page(container, candidate) is not None: