changeset 1538:8d61654cb34f

browser (template): fix `icon_use` when no class is specified
author Goffi <goffi@goffi.org>
date Wed, 28 Jun 2023 10:05:16 +0200
parents c2569408fa35
children bc856e74f74d
files libervia/web/pages/_browser/template.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libervia/web/pages/_browser/template.py	Wed Jun 28 10:05:15 2023 +0200
+++ b/libervia/web/pages/_browser/template.py	Wed Jun 28 10:05:16 2023 +0200
@@ -149,8 +149,9 @@
 
 
 def _icon_use(name, cls=""):
-    kwargs = cls.to_dict()
-    cls = kwargs.get('cls')
+    if cls:
+        kwargs = cls.to_dict()
+        cls = kwargs.get('cls')
     return safe(
         '<svg class="svg-icon{cls}" xmlns="http://www.w3.org/2000/svg" '
         'viewBox="0 0 100 100">\n'