From c387fb18192e9c33dea12eaae3b7f4883a13139a Mon Sep 17 00:00:00 2001 From: Nadia Holmquist Pedersen Date: Sat, 5 Nov 2022 16:57:28 +0100 Subject: [PATCH] mainWindow may be nullptr when audioMute() is called. Fixes potential crash on launch when multiplayer audio output is set to only the current window. --- src/frontend/qt_sdl/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/frontend/qt_sdl/main.cpp b/src/frontend/qt_sdl/main.cpp index e8e30a7e..7a816987 100644 --- a/src/frontend/qt_sdl/main.cpp +++ b/src/frontend/qt_sdl/main.cpp @@ -186,7 +186,8 @@ void audioMute() break; case 2: // only currently focused instance - if (!mainWindow->isActiveWindow()) audioMuted = true; + if (mainWindow != nullptr) + audioMuted = !mainWindow->isActiveWindow(); break; } }