aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xepy.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/epy.py b/epy.py
index 0298b4f..30fe107 100755
--- a/epy.py
+++ b/epy.py
@@ -521,14 +521,16 @@ class Epub(Ebook):
except ValueError:
continue
- assert name is not None
- toc_entries.append(
- TocEntry(
- label=name,
- content_index=idx,
- section=src_id[1] if len(src_id) == 2 else None,
+ # assert name is not None
+ # NOTE: skip empty label
+ if name is not None:
+ toc_entries.append(
+ TocEntry(
+ label=name,
+ content_index=idx,
+ section=src_id[1] if len(src_id) == 2 else None,
+ )
)
- )
except AttributeError as e:
if DEBUG:
raise e