mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-18 15:41:12 +00:00
Safely handle work with no editions error
This commit is contained in:
parent
016930fd0c
commit
332a712d84
1 changed files with 2 additions and 2 deletions
|
@ -145,8 +145,8 @@ class Connector(AbstractConnector):
|
|||
def get_edition_from_work_data(self, data):
|
||||
data = self.load_edition_data(data.get("uri"))
|
||||
try:
|
||||
uri = data["uris"][0]
|
||||
except KeyError:
|
||||
uri = data.get("uris", [])[0]
|
||||
except IndexError:
|
||||
raise ConnectorException("Invalid book data")
|
||||
return self.get_book_data(self.get_remote_id(uri))
|
||||
|
||||
|
|
Loading…
Reference in a new issue