From e8fece60cf4396d47a0dc06c83b32209d9a040ea Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sat, 1 May 2021 02:58:43 +1000 Subject: [PATCH] CommonHostInterface: Fix crash booting exe/psf from file --- src/frontend-common/common_host_interface.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/frontend-common/common_host_interface.cpp b/src/frontend-common/common_host_interface.cpp index beb508837..e0200f827 100644 --- a/src/frontend-common/common_host_interface.cpp +++ b/src/frontend-common/common_host_interface.cpp @@ -2904,8 +2904,10 @@ void CommonHostInterface::GetGameInfo(const char* path, CDImage* image, std::str { *code = list_entry->code; *title = list_entry->title; + return; } - else + + if (image) { GameDatabase database; GameDatabaseEntry database_entry; @@ -2913,14 +2915,15 @@ void CommonHostInterface::GetGameInfo(const char* path, CDImage* image, std::str { *code = std::move(database_entry.serial); *title = std::move(database_entry.title); + return; } else { - *title = FileSystem::GetFileTitleFromPath(std::string(path)); - if (image) - *code = System::GetGameCodeForImage(image, true); + *code = System::GetGameCodeForImage(image, true); } } + + *title = FileSystem::GetFileTitleFromPath(path); } bool CommonHostInterface::SaveResumeSaveState()