added null checks to theme.c, removed and added newline in language.c
This commit is contained in:
parent
624fbed1fd
commit
cd8698c4b0
@ -319,7 +319,6 @@ const char* const g_strings[StrId_Max][16] =
|
||||
STR_TW("应用"),
|
||||
},
|
||||
|
||||
|
||||
[StrId_ThemeMenu] =
|
||||
{
|
||||
STR_EN("Theme Menu"),
|
||||
|
@ -176,12 +176,17 @@ void SetThemePathToConfig(const char* themePath) {
|
||||
|
||||
if(good_cfg) {
|
||||
group = config_lookup(&cfg, "hbmenuConfig");
|
||||
if(group != NULL)
|
||||
setting = config_setting_lookup(group, "themePath");
|
||||
if(setting != NULL)
|
||||
config_setting_set_string(setting, themePath);
|
||||
} else {
|
||||
root = config_root_setting(&cfg);
|
||||
if(root != NULL)
|
||||
group = config_setting_add(root, "hbmenuConfig", CONFIG_TYPE_GROUP);
|
||||
if(group != NULL)
|
||||
setting = config_setting_add(group, "themePath", CONFIG_TYPE_STRING);
|
||||
if(setting != NULL)
|
||||
config_setting_set_string(setting, themePath);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user