Fix metadata search crash when ComicVine or Douban return None on error
Both comicvine.py and douban.py return None instead of [] when an HTTP error occurs during a metadata search. The consumer in search_metadata.py iterates the result directly, which raises TypeError: 'NoneType' object is not iterable and crashes the server on single-threaded deployments. Fixes #3606
This commit is contained in:
@@ -57,7 +57,7 @@ class ComicVine(Metadata):
|
|||||||
result.raise_for_status()
|
result.raise_for_status()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.warning(e)
|
log.warning(e)
|
||||||
return None
|
return []
|
||||||
for result in result.json()["results"]:
|
for result in result.json()["results"]:
|
||||||
match = self._parse_search_result(
|
match = self._parse_search_result(
|
||||||
result=result, generic_cover=generic_cover, locale=locale
|
result=result, generic_cover=generic_cover, locale=locale
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ class Douban(Metadata):
|
|||||||
r.raise_for_status()
|
r.raise_for_status()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.warning(e)
|
log.warning(e)
|
||||||
return None
|
return []
|
||||||
|
|
||||||
match = MetaRecord(
|
match = MetaRecord(
|
||||||
id=id,
|
id=id,
|
||||||
|
|||||||
Reference in New Issue
Block a user