Merge pull request #787 from Gluejar/fix-regression

Fix regression
pull/91/head
eshellman 2018-06-19 14:30:33 -04:00 committed by GitHub
commit 2b2df9d3b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -273,8 +273,11 @@ def add_by_isbn_from_google(isbn, work=None):
logger.info(u"adding new book by isbn %s", isbn) logger.info(u"adding new book by isbn %s", isbn)
results = get_google_isbn_results(isbn) results = get_google_isbn_results(isbn)
if results: if results and 'items' in results:
item = get_isbn_item(results['items'], isbn) item = get_isbn_item(results['items'], isbn)
if not item:
logger.exception(u"no items for %s", isbn)
return None
try: try:
return add_by_googlebooks_id( return add_by_googlebooks_id(
item['id'], item['id'],