From 3f396895e588e62183e01d17927d9bdbea512ee0 Mon Sep 17 00:00:00 2001 From: Jonas L Date: Thu, 28 Dec 2023 14:05:35 +0100 Subject: [PATCH] fix(worker): unbound variable when episode url returns HTTP 404 (#2844) ### Description When the episode URL return a 404, the tmp_file is never set, and we have an unbound variable exception. --- worker/libretime_worker/tasks.py | 1 + 1 file changed, 1 insertion(+) diff --git a/worker/libretime_worker/tasks.py b/worker/libretime_worker/tasks.py index d7d189cc0..1934c5551 100644 --- a/worker/libretime_worker/tasks.py +++ b/worker/libretime_worker/tasks.py @@ -59,6 +59,7 @@ def podcast_download( Status of the podcast download as JSON string. """ result: Dict[str, Any] = {"episodeid": episode_id} + tmp_file = None try: # Download podcast episode file