From a8a89aab9c0e0f9b5faf2195cd57bb91feae2b98 Mon Sep 17 00:00:00 2001 From: rlaphoenix Date: Thu, 15 Feb 2024 23:45:44 +0000 Subject: [PATCH] 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. --- devine/core/downloaders/aria2c.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devine/core/downloaders/aria2c.py b/devine/core/downloaders/aria2c.py index e97b37d..be13061 100644 --- a/devine/core/downloaders/aria2c.py +++ b/devine/core/downloaders/aria2c.py @@ -212,8 +212,8 @@ def download( secret=rpc_secret, method="aria2.tellStopped", params=[0, 999999] - ) - for dl in stopped_downloads or []: + ) or [] + for dl in stopped_downloads: if dl["status"] == "complete": yield dict(advance=1) elif dl["status"] == "error":