Skip to content

Commit

Permalink
Add a null check in PopupMultiChoice::UpdateText
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Sep 27, 2023
1 parent cbbaf14 commit 3d14cd1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion Common/UI/PopupScreens.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_ = "";
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions UI/RemoteISOScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 3d14cd1

Please sign in to comment.