From 933c3d965f896d3a479fa911f93b5057d6970724 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 14 Nov 2020 17:01:25 +0000 Subject: [PATCH] Use default theme if theme function not found --- theme.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/theme.py b/theme.py index c6f711e7..371cb5fe 100644 --- a/theme.py +++ b/theme.py @@ -1404,7 +1404,16 @@ def setTheme(baseDir: str, name: str, domain: str) -> bool: for themeName in themes: themeNameLower = themeName.lower() if name == themeNameLower: - globals()['setTheme' + themeName](baseDir) + themeFunctionExists = False + try: + globals()['setTheme' + themeName](baseDir) + themeFunctionExists = True + except BaseException: + pass + + if not themeFunctionExists: + setThemeDefault(baseDir) + if prevThemeName: if prevThemeName.lower() != themeNameLower: # change the banner and profile image