From adab4dcd12820d6b1afd44630b4ff9fe6f90958d Mon Sep 17 00:00:00 2001 From: Raphael Coeffic Date: Sun, 16 Oct 2022 11:42:01 +0200 Subject: [PATCH] fix(color): check `theme` before accessing it Fixes #2566 --- radio/src/gui/colorlcd/radio_theme.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/radio/src/gui/colorlcd/radio_theme.cpp b/radio/src/gui/colorlcd/radio_theme.cpp index eda19cab3..398428a42 100644 --- a/radio/src/gui/colorlcd/radio_theme.cpp +++ b/radio/src/gui/colorlcd/radio_theme.cpp @@ -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());