Additional check for incomplete data from HC

This commit is contained in:
phil.borman@gmail.com 2026-02-05 18:27:37 +01:00
parent 3dd2f0da1f
commit 432ddf8e39

View File

@ -903,7 +903,7 @@ query FindAuthor { authors_by_pk(id: [authorid])
if authorname in item['document']['author_names']:
bookid = item['document']['id']
break
except (IndexError, KeyError):
except (IndexError, KeyError, TypeError):
pass
if bookid:
@ -914,7 +914,7 @@ query FindAuthor { authors_by_pk(id: [authorid])
if item['contributions'] and 'cachedImage' in item['contributions'][0]['author']:
url = item['contributions'][0]['author']['cachedImage']['url']
break
except (IndexError, KeyError):
except (IndexError, KeyError, TypeError):
pass
if url: