From 6e4b33e74df427bb6a9adf2d4c03a98033de41b5 Mon Sep 17 00:00:00 2001 From: Vadim Grigoruk Date: Sat, 11 Aug 2018 09:13:18 +0300 Subject: [PATCH] #582 fix --- src/console.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/console.c b/src/console.c index d59157c..4863a50 100644 --- a/src/console.c +++ b/src/console.c @@ -1075,22 +1075,26 @@ static void onConsoleLoadCommandConfirmed(Console* console, const char* param) static void load(Console* console, const char* path, const char* hash) { - s32 size = 0; - const char* name = getCartName(path); - - void* data = fsLoadFileByHash(console->fs, hash, &size); - - if(data) + if(hash) { - console->showGameMenu = true; + s32 size = 0; + const char* name = getCartName(path); - loadRom(console->tic, data, size, true); - onCartLoaded(console, name); + void* data = fsLoadFileByHash(console->fs, hash, &size); - free(data); + if(data) + { + console->showGameMenu = true; + + loadRom(console->tic, data, size, true); + onCartLoaded(console, name); + + free(data); + } + + commandDone(console); } - - commandDone(console); + else onConsoleLoadCommandConfirmed(console, path); } typedef void(*ConfirmCallback)(Console* console, const char* param);