handle non-existent icons
This commit is contained in:
parent
cf503a7b7d
commit
8fc65f467c
|
@ -128,7 +128,11 @@ def Icon(
|
|||
name: str,
|
||||
attributes: list[HTMLAttribute] = [],
|
||||
):
|
||||
return Component(template=f"cotton/icon/{name}.html", attributes=attributes)
|
||||
try:
|
||||
result = Component(template=f"cotton/icon/{name}.html", attributes=attributes)
|
||||
except TemplateDoesNotExist:
|
||||
result = Icon(name="unspecified", attributes=attributes)
|
||||
return result
|
||||
|
||||
|
||||
def LinkedNameWithPlatformIcon(name: str, game_id: int, platform: str) -> SafeText:
|
||||
|
|
Loading…
Reference in New Issue