From ff3b033815f8ffedded34b95faf1ed4a9242fbb5 Mon Sep 17 00:00:00 2001 From: Jamiras Date: Sat, 4 Apr 2020 09:28:11 -0600 Subject: [PATCH] prevent null reference rendering achievement list while closing emulator --- cheevos-new/cheevos.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cheevos-new/cheevos.c b/cheevos-new/cheevos.c index fde56d6494..5ea558f276 100644 --- a/cheevos-new/cheevos.c +++ b/cheevos-new/cheevos.c @@ -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)