From 4836d17783abbb8647576a748a165887052c5cf9 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 10 Mar 2014 08:25:40 +0530 Subject: [PATCH] Fix #1290097 ["epub" without toc crashes](https://bugs.launchpad.net/calibre/+bug/1290097) --- src/calibre/ebooks/oeb/polish/toc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/oeb/polish/toc.py b/src/calibre/ebooks/oeb/polish/toc.py index 98d5e534fc..ac87b7ae66 100644 --- a/src/calibre/ebooks/oeb/polish/toc.py +++ b/src/calibre/ebooks/oeb/polish/toc.py @@ -182,7 +182,7 @@ def find_existing_toc(container): def get_toc(container, verify_destinations=True): toc = find_existing_toc(container) - if toc is None: + if toc is None or not container.has_name(toc): ans = TOC() ans.lang = ans.uid = None return ans