From 3d40e83700bd2ad8f945364e52f33432c4180542 Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 28 Mar 2023 01:31:39 +0100 Subject: [PATCH] S_SoundTestPlay: Exit early into S_SoundTestStop if current entry is NULL --- src/s_sound.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/s_sound.c b/src/s_sound.c index 5c5483b01..fa6bf53be 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -1403,19 +1403,18 @@ conclusion: if (soundtest.playing == true) { - if (newdef == NULL) - { - S_SoundTestStop(false); - } - else - { - S_SoundTestPlay(); - } + S_SoundTestPlay(); } } void S_SoundTestPlay(void) { + if (soundtest.current == NULL) + { + S_SoundTestStop(false); + return; + } + soundtest.privilegedrequest = true; S_StopMusic();