From 1ba49fe21dea4a6cc7917d5bccdc5564ef6c0da0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Fri, 11 Oct 2024 12:35:53 +0200 Subject: [PATCH] Crashfix --- UI/MemStickScreen.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/UI/MemStickScreen.cpp b/UI/MemStickScreen.cpp index 508af920bc..fffb2f8321 100644 --- a/UI/MemStickScreen.cpp +++ b/UI/MemStickScreen.cpp @@ -584,15 +584,19 @@ void ConfirmMemstickMoveScreen::update() { if (newSpaceTask_ && newFreeSpaceView_) { SpaceResult *result = newSpaceTask_->Poll(); - newFreeSpaceView_->SetText(std::string(ms->T("Free space")) + ": " + FormatSpaceString(result->bytesFree)); - delete newSpaceTask_; - newSpaceTask_ = nullptr; + if (result) { + newFreeSpaceView_->SetText(std::string(ms->T("Free space")) + ": " + FormatSpaceString(result->bytesFree)); + delete newSpaceTask_; + newSpaceTask_ = nullptr; + } } if (oldSpaceTask_ && oldFreeSpaceView_) { SpaceResult *result = oldSpaceTask_->Poll(); - oldFreeSpaceView_->SetText(std::string(ms->T("Free space")) + ": " + FormatSpaceString(result->bytesFree)); - delete oldSpaceTask_; - oldSpaceTask_ = nullptr; + if (result) { + oldFreeSpaceView_->SetText(std::string(ms->T("Free space")) + ": " + FormatSpaceString(result->bytesFree)); + delete oldSpaceTask_; + oldSpaceTask_ = nullptr; + } } }