From c420ec0463d79ed9ac32f513fa7ff2d19c605192 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 9 Feb 2014 22:23:31 +0530 Subject: [PATCH] ... --- src/calibre/library/catalogs/epub_mobi_builder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/library/catalogs/epub_mobi_builder.py b/src/calibre/library/catalogs/epub_mobi_builder.py index e53ed85a3c..884526761c 100644 --- a/src/calibre/library/catalogs/epub_mobi_builder.py +++ b/src/calibre/library/catalogs/epub_mobi_builder.py @@ -1233,7 +1233,7 @@ class CatalogBuilder(object): else: # Validate custom field is usable as a genre source field_md = self.db.metadata_for_field(self.opts.genre_source_field) - if not field_md['datatype'] in ['enumeration', 'text']: + if field_md is None or not field_md['datatype'] in ['enumeration', 'text']: all_custom_fields = self.db.custom_field_keys() eligible_custom_fields = [] for cf in all_custom_fields: