From 5782cd6d2ee17eb613055e6b641f01dcd58af80e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Robert=20B=C5=82aut?= Date: Wed, 5 Mar 2014 14:38:44 +0100 Subject: [PATCH] fix impovement for IT #3356 - workaround rare problem --- librarian/epub.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/librarian/epub.py b/librarian/epub.py index 8220ccb..8dba5ac 100644 --- a/librarian/epub.py +++ b/librarian/epub.py @@ -284,7 +284,10 @@ class TOC(object): nav_label = nav_map.makeelement(NCXNS('navLabel')) text = nav_map.makeelement(NCXNS('text')) - text.text = re.sub(r'\n', ' ', child.name) + if child.name is not None: + text.text = re.sub(r'\n', ' ', child.name) + else: + text.text = child.name nav_label.append(text) nav_point.append(nav_label) -- 2.20.1