Fix #996439 ('NoneType' object has no attribute 'partition' (Error Code: 1) when converitng to AWZ3)

This commit is contained in:
Kovid Goyal 2012-05-08 19:15:09 +05:30
parent 0458a601e8
commit cf97f6228a

View File

@ -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)