Skip to content

Commit

Permalink
mainWindow may be nullptr when audioMute() is called.
Browse files Browse the repository at this point in the history
Fixes potential crash on launch when multiplayer audio output is set to only the current window.
  • Loading branch information
nadiaholmquist committed Nov 5, 2022
1 parent 430de6b commit c387fb1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/frontend/qt_sdl/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit c387fb1

Please sign in to comment.