handle malformed responses passively

This commit is contained in:
meeb 2021-02-18 14:55:40 +11:00
parent 647254d7f7
commit 8b93cb4a59
1 changed files with 2 additions and 0 deletions

View File

@ -453,6 +453,8 @@ class Source(models.Model):
if not callable(indexer):
raise Exception(f'Source type f"{self.source_type}" has no indexer')
response = indexer(self.index_url)
if not isinstance(response, dict):
return []
return response.get('entries', [])