From 6463f7cd4c0e5408265298cb2b151ad114accf40 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 4 Apr 2010 08:49:45 +0530 Subject: [PATCH] Fix #5225 (IndexError returned for metadata lookup with ISBN and blank author) --- src/calibre/gui2/dialogs/metadata_single.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/dialogs/metadata_single.py b/src/calibre/gui2/dialogs/metadata_single.py index e144caf150..f44081447b 100644 --- a/src/calibre/gui2/dialogs/metadata_single.py +++ b/src/calibre/gui2/dialogs/metadata_single.py @@ -553,7 +553,10 @@ class MetadataSingleDialog(ResizableDialog, Ui_MetadataSingleDialog): def fetch_metadata(self): isbn = re.sub(r'[^0-9a-zA-Z]', '', unicode(self.isbn.text())) title = qstring_to_unicode(self.title.text()) - author = string_to_authors(unicode(self.authors.text()))[0] + try: + author = string_to_authors(unicode(self.authors.text()))[0] + except IndexError: + author = '' publisher = qstring_to_unicode(self.publisher.currentText()) if isbn or title or author or publisher: d = FetchMetadata(self, isbn, title, author, publisher, self.timeout)