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:
|
with open(icon_path, "rb") as file:
|
||||||
icon = file.read()
|
icon = file.read()
|
||||||
cicon = str(icon)
|
cicon = str(icon)
|
||||||
fill = re.search(r"fill=\"(.*?)\"", cicon).group(1)
|
try:
|
||||||
icon = icon.replace(fill.encode(), config.color.encode())
|
fill = re.search(r"fill=\"(.*?)\"", cicon).group(1)
|
||||||
|
except AttributeError:
|
||||||
|
fill = None
|
||||||
|
if fill:
|
||||||
|
icon = icon.replace(fill.encode(), config.color.encode())
|
||||||
return icon
|
return icon
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user