fix impovement for IT #3356 - workaround rare problem
authorRobert Błaut <listy@blaut.biz>
Wed, 5 Mar 2014 13:38:44 +0000 (14:38 +0100)
committerRobert Błaut <listy@blaut.biz>
Wed, 5 Mar 2014 13:38:44 +0000 (14:38 +0100)
librarian/epub.py

index 8220ccb..8dba5ac 100644 (file)
@@ -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)