mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 17:01:28 +00:00
Fix crash when exiting with no game data
When shutting down with no game data, GameConfig is saved and the pointer is nulled. If a joystick was present, a null dereference occurs when the engine tries to save the joystick config later in the shutdown sequence. Add a check to avoid a crash in this scenario.
This commit is contained in:
parent
390cd2ca98
commit
ed4e23f1ec
1 changed files with 1 additions and 1 deletions
|
@ -169,7 +169,7 @@ void M_SaveJoystickConfig(IJoystickConfig *joy)
|
||||||
char key[32], value[32];
|
char key[32], value[32];
|
||||||
int axislen, numaxes;
|
int axislen, numaxes;
|
||||||
|
|
||||||
if (M_SetJoystickConfigSection(joy, true))
|
if (GameConfig != NULL && M_SetJoystickConfigSection(joy, true))
|
||||||
{
|
{
|
||||||
GameConfig->ClearCurrentSection();
|
GameConfig->ClearCurrentSection();
|
||||||
if (!joy->IsSensitivityDefault())
|
if (!joy->IsSensitivityDefault())
|
||||||
|
|
Loading…
Reference in a new issue