From c8b02131d7cb78edf4f21b7e7608e624485ae693 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Tue, 10 Sep 2024 11:45:05 +0200 Subject: [PATCH] option/controls: fix crash with console cheats Resolves #230. --- src/game/option/option_controls.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/game/option/option_controls.c b/src/game/option/option_controls.c index 35ec856e..a401c2f7 100644 --- a/src/game/option/option_controls.c +++ b/src/game/option/option_controls.c @@ -9,8 +9,10 @@ static UI_CONTROLS_CONTROLLER m_ControlsDialogController; void Option_Controls_Shutdown(void) { - m_ControlsDialog->free(m_ControlsDialog); - m_ControlsDialog = NULL; + if (m_ControlsDialog != NULL) { + m_ControlsDialog->free(m_ControlsDialog); + m_ControlsDialog = NULL; + } Input_CheckConflictsWithDefaults(); }