Add a null check in PopupMultiChoice::UpdateText

This commit is contained in:
Henrik Rydgård 2023-09-27 00:28:02 +02:00
parent cbbaf148f4
commit 3d14cd16eb
2 changed files with 7 additions and 3 deletions

View File

@ -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_ = "";
}
}
}

View File

@ -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;
}