Aria2c: Fallback to an empty list if stopped_downloads is None

This was fine during most testing in the `for` loop below it, but there's also a len() a bit below that.
This commit is contained in:
rlaphoenix 2024-02-15 23:45:44 +00:00
parent 837015b4ea
commit a8a89aab9c
1 changed files with 2 additions and 2 deletions

View File

@ -212,8 +212,8 @@ def download(
secret=rpc_secret, secret=rpc_secret,
method="aria2.tellStopped", method="aria2.tellStopped",
params=[0, 999999] params=[0, 999999]
) ) or []
for dl in stopped_downloads or []: for dl in stopped_downloads:
if dl["status"] == "complete": if dl["status"] == "complete":
yield dict(advance=1) yield dict(advance=1)
elif dl["status"] == "error": elif dl["status"] == "error":