From 70e602eeda22704341343adea2dc600fbbe984e0 Mon Sep 17 00:00:00 2001 From: Arter Tendean Date: Sun, 22 Sep 2024 16:42:28 +0700 Subject: [PATCH] Adding empty urls handler --- waifu/utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/waifu/utils.py b/waifu/utils.py index a9b121b..089e649 100644 --- a/waifu/utils.py +++ b/waifu/utils.py @@ -69,6 +69,9 @@ def refresh_serializer_data_urls(data: list[dict]) -> list[dict]: if "media.discordapp.net" in item.get("thumbnail", ""): urls.append(item.get("thumbnail")) + if not urls: + return data + refreshed_urls = refresh_expired_urls(urls) for item in data: