desktop-ui: fix an issue where the game browser would crash the emulator if medium::create failed

このコミットが含まれているのは:
Luke Usher 2023-07-19 13:35:01 +01:00
コミット ee6a7fe78d
1個のファイルの変更6行の追加0行の削除

ファイルの表示

@ -23,6 +23,12 @@ auto GameBrowserWindow::show(shared_pointer<Emulator> emulator) -> void {
games.reset();
auto tmp = (shared_pointer<mia::Medium>)mia::Medium::create(emulator->medium);
if(!tmp) {
string text = {"Failed to load Medium: ", emulator->medium};
MessageDialog().setTitle("Error").setText(text).setAlignment(presentation).error();
return;
}
auto db = tmp->database();
for(auto node : db.list) {
auto path = settings.paths.arcadeRoms;