Fix obscure crash possibility (call stack found), some clarification

This commit is contained in:
Henrik Rydgård 2023-05-05 00:00:11 +02:00
parent 9a2ca4836a
commit 1bd7da221b
3 changed files with 2 additions and 4 deletions

View file

@ -1420,7 +1420,7 @@ void GameSettingsScreen::dialogFinished(const Screen *dialog, DialogResult resul
}
void GameSettingsScreen::RecreateViews() {
oldSettingInfo_ = settingInfo_->GetText();
oldSettingInfo_ = settingInfo_ ? settingInfo_->GetText() : "N/A";
UIScreen::RecreateViews();
}

View file

@ -74,8 +74,6 @@ private:
UI::EventReturn OnConfirmClick(UI::EventParams &params);
UI::EventReturn OnChoiceClick(UI::EventParams &params);
SettingInfoMessage *settingInfo_ = nullptr;
bool initialSetup_;
bool storageBrowserWorking_;
bool done_ = false;

View file

@ -1114,5 +1114,5 @@ void SettingInfoMessage::Draw(UIContext &dc) {
}
std::string SettingInfoMessage::GetText() const {
return showing_ && text_ ? text_->GetText() : "";
return (showing_ && text_) ? text_->GetText() : "";
}