From 0f0bcd48ba546aac7779311f9edfc21f6468ca34 Mon Sep 17 00:00:00 2001 From: WorldTeacher <41587052+WorldTeacher@users.noreply.github.com> Date: Mon, 29 Jul 2024 10:29:51 +0200 Subject: [PATCH] add try except for icons that do not have fill --- src/utils/icon.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/utils/icon.py b/src/utils/icon.py index c75dd97..3b75378 100644 --- a/src/utils/icon.py +++ b/src/utils/icon.py @@ -67,8 +67,12 @@ class Icon: with open(icon_path, "rb") as file: icon = file.read() cicon = str(icon) - fill = re.search(r"fill=\"(.*?)\"", cicon).group(1) - icon = icon.replace(fill.encode(), config.color.encode()) + try: + fill = re.search(r"fill=\"(.*?)\"", cicon).group(1) + except AttributeError: + fill = None + if fill: + icon = icon.replace(fill.encode(), config.color.encode()) return icon