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:
walrusec
2026-04-19 08:54:47 -04:00
parent fca580505c
commit 0ca6e86177
2 changed files with 2 additions and 2 deletions

View File

@@ -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

View File

@@ -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,