Merge pull request #10398 from Jamiras/cheevos_null_check

[cheevos] prevent null reference rendering achievement list while closing application
This commit is contained in:
Autechre 2020-04-05 13:05:59 +02:00 committed by GitHub
commit 5b5a086fd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1133,12 +1133,12 @@ void rcheevos_get_achievement_state(unsigned index, char *buffer, size_t buffer_
if (index < rcheevos_locals.patchdata.core_count)
{
enum_idx = MENU_ENUM_LABEL_VALUE_CHEEVOS_LOCKED_ENTRY;
cheevo = &rcheevos_locals.core[index];
cheevo = rcheevos_locals.core ? &rcheevos_locals.core[index] : NULL;
}
else
{
enum_idx = MENU_ENUM_LABEL_VALUE_CHEEVOS_UNOFFICIAL_ENTRY;
cheevo = &rcheevos_locals.unofficial[index - rcheevos_locals.patchdata.core_count];
cheevo = rcheevos_locals.unofficial ? &rcheevos_locals.unofficial[index - rcheevos_locals.patchdata.core_count] : NULL;
}
if (!cheevo || !cheevo->trigger)