From 1bd7da221bf9f995c0925bedcc84654583e03a8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Fri, 5 May 2023 00:00:11 +0200 Subject: [PATCH] Fix obscure crash possibility (call stack found), some clarification --- UI/GameSettingsScreen.cpp | 2 +- UI/MemStickScreen.h | 2 -- UI/MiscScreens.cpp | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 77553ab313..a427f12dce 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -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(); } diff --git a/UI/MemStickScreen.h b/UI/MemStickScreen.h index 3912e095bc..ae0a22c1a7 100644 --- a/UI/MemStickScreen.h +++ b/UI/MemStickScreen.h @@ -74,8 +74,6 @@ private: UI::EventReturn OnConfirmClick(UI::EventParams ¶ms); UI::EventReturn OnChoiceClick(UI::EventParams ¶ms); - SettingInfoMessage *settingInfo_ = nullptr; - bool initialSetup_; bool storageBrowserWorking_; bool done_ = false; diff --git a/UI/MiscScreens.cpp b/UI/MiscScreens.cpp index 527cfe39b6..6754c0a14b 100644 --- a/UI/MiscScreens.cpp +++ b/UI/MiscScreens.cpp @@ -1114,5 +1114,5 @@ void SettingInfoMessage::Draw(UIContext &dc) { } std::string SettingInfoMessage::GetText() const { - return showing_ && text_ ? text_->GetText() : ""; + return (showing_ && text_) ? text_->GetText() : ""; }