diff --git a/src/calibre/ebooks/mobi/reader/mobi6.py b/src/calibre/ebooks/mobi/reader/mobi6.py index d817d58b21..407e6e1c12 100644 --- a/src/calibre/ebooks/mobi/reader/mobi6.py +++ b/src/calibre/ebooks/mobi/reader/mobi6.py @@ -782,7 +782,7 @@ class MobiReader: if flags & 1: try: num += sizeof_trailing_entry(data, size - num) - except IndexError: + except (IndexError, TypeError): self.warn_about_trailing_entry_corruption() return 0 flags >>= 1