Fix edge case where invalid theme_settings cause broken frontend (#2034)

* Fix edge case where invalid `theme_settings` cause broken frontend
This commit is contained in:
Kevin Chung
2021-12-08 15:47:00 -05:00
committed by GitHub
parent d79f24b2e5
commit c1a27176b6
4 changed files with 7 additions and 3 deletions

View File

@@ -76,7 +76,10 @@ class _ConfigsWrapper:
@property
def theme_settings(self):
return json.loads(get_config("theme_settings", default="null"))
try:
return json.loads(get_config("theme_settings", default="null"))
except json.JSONDecodeError:
return {"error": "invalid theme_settings"}
@property
def tos_or_privacy(self):

View File

@@ -410,6 +410,7 @@ $(() => {
{
lineNumbers: true,
lineWrapping: true,
readOnly: true,
mode: { name: "javascript", json: true }
}
);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long