diff options
author | Nadia Holmquist Pedersen <nadia@nhp.sh> | 2022-11-05 16:57:28 +0100 |
---|---|---|
committer | Nadia Holmquist Pedersen <nadia@nhp.sh> | 2022-11-05 16:57:28 +0100 |
commit | c387fb18192e9c33dea12eaae3b7f4883a13139a (patch) | |
tree | 8ecaefffbc4c346c57382052eb38f143fa89c33a /src | |
parent | 430de6b2702bb93faa8c2004aff3fbd084db4a1e (diff) |
mainWindow may be nullptr when audioMute() is called.
Fixes potential crash on launch when multiplayer audio output is set to only the current window.
Diffstat (limited to 'src')
-rw-r--r-- | src/frontend/qt_sdl/main.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/frontend/qt_sdl/main.cpp b/src/frontend/qt_sdl/main.cpp index e8e30a7..7a81698 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; } } |