From f39f48ce134e48bbac03c7e5b43ea2e2b57e27b3 Mon Sep 17 00:00:00 2001 From: awsr <43862868+awsr@users.noreply.github.com> Date: Thu, 23 Apr 2026 16:13:20 -0700 Subject: [PATCH] Don't send `None` to `html_css` function --- modules/ui_javascript.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/modules/ui_javascript.py b/modules/ui_javascript.py index 392525078..45f86254f 100644 --- a/modules/ui_javascript.py +++ b/modules/ui_javascript.py @@ -67,11 +67,10 @@ def html_css(css: list[str]): return f'' head = '' - if css is not None: - for cssfile in css: - f = os.path.join(script_path, 'javascript', cssfile) - if os.path.isfile(f): - head += stylesheet(f) + for cssfile in css: + f = os.path.join(script_path, 'javascript', cssfile) + if os.path.isfile(f): + head += stylesheet(f) for cssfile in modules.scripts_manager.list_files_with_name("style.css"): if not os.path.isfile(cssfile): continue @@ -104,9 +103,12 @@ def reload_javascript(): login = html_login() js = html_head() - css_base = theme.reload_gradio_theme() - css_timesheet = "timesheet.css" - css = html_css([css_base, css_timesheet]) + css_files: list[str] = [] + if (css_base := theme.reload_gradio_theme()) is not None: + css_files.append(css_base) + css_files.append("timesheet.css") + + css = html_css(css_files) body = html_body() def template_response(*args, **kwargs):