diff --git a/radio/src/lua/widgets.cpp b/radio/src/lua/widgets.cpp index ccf2b347e..8ccc7c883 100644 --- a/radio/src/lua/widgets.cpp +++ b/radio/src/lua/widgets.cpp @@ -234,14 +234,17 @@ void luaLoadThemeCallback() } if (name) { - ZoneOption * options = createOptionsArray(themeOptions, MAX_THEME_OPTIONS); - if (options) { - LuaTheme * theme = new LuaTheme(name, options); - theme->loadFunction = loadFunction; - theme->drawBackgroundFunction = drawBackgroundFunction; - theme->drawTopbarBackgroundFunction = drawTopbarBackgroundFunction; - TRACE("Loaded Lua theme %s", name); + ZoneOption * options = NULL; + if (themeOptions) { + options = createOptionsArray(themeOptions, MAX_THEME_OPTIONS); + if (!options) + return; } + LuaTheme * theme = new LuaTheme(name, options); + theme->loadFunction = loadFunction; + theme->drawBackgroundFunction = drawBackgroundFunction; + theme->drawTopbarBackgroundFunction = drawTopbarBackgroundFunction; + TRACE("Loaded Lua theme %s", name); } }