diff --git a/src/calibre/ebooks/mobi/writer2/main.py b/src/calibre/ebooks/mobi/writer2/main.py index c1fafc3f8b..ed0e43a303 100644 --- a/src/calibre/ebooks/mobi/writer2/main.py +++ b/src/calibre/ebooks/mobi/writer2/main.py @@ -201,7 +201,7 @@ class MobiWriter(object): finally: item.unload_data_from_memory() - if self.image_records[0] is None: + if self.image_records and self.image_records[0] is None: raise ValueError('Failed to find masthead image in manifest') # }}}