From 837211f43721e1918001718d0d0b531399b02e5a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 13 Aug 2014 22:14:11 +0530 Subject: [PATCH] ... --- src/calibre/ebooks/mobi/reader/mobi8.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/mobi/reader/mobi8.py b/src/calibre/ebooks/mobi/reader/mobi8.py index 47766cf2b8..08c2b1e842 100644 --- a/src/calibre/ebooks/mobi/reader/mobi8.py +++ b/src/calibre/ebooks/mobi/reader/mobi8.py @@ -432,7 +432,7 @@ class Mobi8Reader(object): href = 'images/%05d.%s'%(container.resource_index, imgtype) with open(href.replace('/', os.sep), 'wb') as f: f.write(data) - elif typ == b'\xa0\xa0\xa0\xa0' and len(data) == 4: + elif typ == b'\xa0\xa0\xa0\xa0' and len(data) == 4 and container is not None: container.resource_index += 1 elif container is None: if not (len(data) == len(PLACEHOLDER_GIF) and data == PLACEHOLDER_GIF):