From 60e23002f52208c016b2427a76b2ff15656c1444 Mon Sep 17 00:00:00 2001 From: Sahin Habermann Date: Sun, 25 Feb 2018 14:36:17 +0100 Subject: [PATCH] Fix crashing when trying to get NULL entry type --- common/menu.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/common/menu.c b/common/menu.c index 91ce790..efd9b5c 100644 --- a/common/menu.c +++ b/common/menu.c @@ -384,13 +384,15 @@ void menuLoop() { drawEntry(me, entry_start_x + x, is_active); } - if (active_entry->type != ENTRY_TYPE_FOLDER) { - drawImage(1280 - 126 - 30, 720 - 48, 32, 32, themeCurrent.buttonAImage, IMAGE_MODE_RGBA32); - DrawText(interuiregular18, 1280 - 90 - 30, 720 - 47, themeCurrent.textColor, textGetString(StrId_Actions_Launch)); - } - else { - drawImage(1280 - 126 - 30, 720 - 48, 32, 32, themeCurrent.buttonAImage, IMAGE_MODE_RGBA32); - DrawText(interuiregular18, 1280 - 90 - 30, 720 - 47, themeCurrent.textColor, textGetString(StrId_Actions_Open)); + if(active_entry != NULL) { + if (active_entry->type != ENTRY_TYPE_FOLDER) { + drawImage(1280 - 126 - 30, 720 - 48, 32, 32, themeCurrent.buttonAImage, IMAGE_MODE_RGBA32); + DrawText(interuiregular18, 1280 - 90 - 30, 720 - 47, themeCurrent.textColor, textGetString(StrId_Actions_Launch)); + } + else { + drawImage(1280 - 126 - 30, 720 - 48, 32, 32, themeCurrent.buttonAImage, IMAGE_MODE_RGBA32); + DrawText(interuiregular18, 1280 - 90 - 30, 720 - 47, themeCurrent.textColor, textGetString(StrId_Actions_Open)); + } } drawBackBtn(menu, false);