From cf97f6228a0833ae871ea15506d0a70e454a27d9 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 8 May 2012 19:15:09 +0530 Subject: [PATCH] Fix #996439 ('NoneType' object has no attribute 'partition' (Error Code: 1) when converitng to AWZ3) --- src/calibre/ebooks/mobi/writer8/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/mobi/writer8/main.py b/src/calibre/ebooks/mobi/writer8/main.py index 4e6719bb90..acba9be454 100644 --- a/src/calibre/ebooks/mobi/writer8/main.py +++ b/src/calibre/ebooks/mobi/writer8/main.py @@ -316,7 +316,7 @@ class KF8Writer(object): # Flatten the ToC into a depth first list fl = toc.iter() if is_periodical else toc.iterdescendants() for i, item in enumerate(fl): - entry = {'id': id(item), 'index': i, 'href':item.href, + entry = {'id': id(item), 'index': i, 'href':item.href or '', 'label':(item.title or _('Unknown')), 'children':[]} entry['depth'] = getattr(item, 'ncx_hlvl', 0)