mirror of
https://github.com/libretro/RetroArch
synced 2025-03-18 13:20:57 +00:00
First test if global is set before testing its members
This commit is contained in:
parent
a1217a9e08
commit
5894da8759
@ -1654,6 +1654,12 @@ bool config_load_override(void)
|
||||
global_t *global = global_get_ptr(); /* global pointer */
|
||||
settings_t *settings = config_get_ptr(); /* config pointer */
|
||||
|
||||
if (!global || !settings )
|
||||
{
|
||||
RARCH_ERR("Could not obtain global pointer or configuration file pointer to retrieve path of retroarch.cfg.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
//early return in case a library isn't loaded
|
||||
if(!global->system.info.library_name || !strcmp(global->system.info.library_name,"No Core"))
|
||||
return true;
|
||||
@ -1661,12 +1667,6 @@ bool config_load_override(void)
|
||||
RARCH_LOG("Game name: %s\n",global->basename);
|
||||
RARCH_LOG("Core name: %s\n",global->system.info.library_name);
|
||||
|
||||
if (!global || !settings )
|
||||
{
|
||||
RARCH_ERR("Could not obtain global pointer or configuration file pointer to retrieve path of retroarch.cfg.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Config directory: config_directory. */
|
||||
if (settings->menu_config_directory) /* Try RGUI path setting first */
|
||||
strlcpy(config_directory, settings->menu_config_directory, PATH_MAX_LENGTH);
|
||||
|
Loading…
x
Reference in New Issue
Block a user