From 3d14cd16eb5c83423010d1aaaabab2522c5269c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Wed, 27 Sep 2023 00:28:02 +0200 Subject: [PATCH] Add a null check in PopupMultiChoice::UpdateText --- Common/UI/PopupScreens.cpp | 6 +++++- UI/RemoteISOScreen.cpp | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Common/UI/PopupScreens.cpp b/Common/UI/PopupScreens.cpp index 95714b9de76f..1d470d1242da 100644 --- a/Common/UI/PopupScreens.cpp +++ b/Common/UI/PopupScreens.cpp @@ -122,7 +122,11 @@ void PopupMultiChoice::UpdateText() { if (index < 0 || index >= numChoices_) { valueText_ = "(invalid choice)"; // Shouldn't happen. Should be no need to translate this. } else { - valueText_ = T(category_, choices_[index]); + if (choices_[index]) { + valueText_ = T(category_, choices_[index]); + } else { + valueText_ = ""; + } } } diff --git a/UI/RemoteISOScreen.cpp b/UI/RemoteISOScreen.cpp index b80df3002142..9ade1fd80397 100644 --- a/UI/RemoteISOScreen.cpp +++ b/UI/RemoteISOScreen.cpp @@ -503,8 +503,8 @@ void RemoteISOConnectScreen::ExecuteLoad() { class RemoteGameBrowser : public GameBrowser { public: - RemoteGameBrowser(const Path &url, BrowseFlags browseFlags, bool *gridStyle_, ScreenManager *screenManager, std::string lastText, std::string lastLink, UI::LayoutParams *layoutParams = nullptr) - : GameBrowser(url, browseFlags, gridStyle_, screenManager, lastText, lastLink, layoutParams) { + RemoteGameBrowser(const Path &url, BrowseFlags browseFlags, bool *gridStyle, ScreenManager *screenManager, std::string lastText, std::string lastLink, UI::LayoutParams *layoutParams = nullptr) + : GameBrowser(url, browseFlags, gridStyle, screenManager, lastText, lastLink, layoutParams) { initialPath_ = url; }