From 740489f7a4a848bd3f96f1c911a6c7db5f6cc27f Mon Sep 17 00:00:00 2001 From: Nadia Holmquist Pedersen Date: Tue, 26 Dec 2023 08:49:02 +0100 Subject: Don't call Reset on nullptr --- src/frontend/qt_sdl/main.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/frontend/qt_sdl/main.cpp b/src/frontend/qt_sdl/main.cpp index 3f53f3c..7ba37c1 100644 --- a/src/frontend/qt_sdl/main.cpp +++ b/src/frontend/qt_sdl/main.cpp @@ -329,10 +329,14 @@ bool EmuThread::UpdateConsole(UpdateConsoleNDSArgs&& ndsargs, UpdateConsoleGBAAr NDS::Current = nullptr; NDS = CreateConsole(std::move(nextndscart), std::move(nextgbacart)); + + if (NDS == nullptr) + return false; + NDS->Reset(); NDS::Current = NDS.get(); - return NDS != nullptr; + return true; } auto arm9bios = ROMManager::LoadARM9BIOS(); -- cgit v1.2.3