diff --git a/src/calibre/ebooks/mobi/writer.py b/src/calibre/ebooks/mobi/writer.py index cd6674c2e2..ed102ecc80 100644 --- a/src/calibre/ebooks/mobi/writer.py +++ b/src/calibre/ebooks/mobi/writer.py @@ -251,7 +251,7 @@ class Serializer(object): tag = prefixname(elem.tag, nsrmap) # Previous layers take care of @name id = elem.attrib.pop('id', None) - if id is not None: + if id: href = '#'.join((item.href, id)) offset = self.anchor_offset or buffer.tell() self.id_offsets[urlnormalize(href)] = offset