add try except for icons that do not have fill
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user