fix(color): check theme before accessing it

Fixes #2566
This commit is contained in:
Raphael Coeffic
2022-10-16 11:42:01 +02:00
parent b703f9f305
commit adab4dcd12
+1
View File
@@ -511,6 +511,7 @@ void ThemeSetupPage::setupListbox(FormWindow *window, rect_t r, ThemePersistance
auto value = listBox->getSelected();
if (themeColorPreview && authorText && nameText && fileCarosell) {
ThemeFile *theme = tp->getThemeByIndex(value);
if (!theme) return;
themeColorPreview->setColorList(theme->getColorList());
setAuthor(theme);
nameText->setText(theme->getName());