# SDL: audio: Fixed incorrect assertion

**URL:** <https://discourse.libsdl.org/t/sdl-audio-fixed-incorrect-assertion/45314>\
**Category:** SDL Commits\
**Created:** [August 4, 2023, 1:37am UTC](https://discourse.libsdl.org/t/sdl-audio-fixed-incorrect-assertion/45314 "2023-08-04T01:37:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SDLPushPostBot](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/sdlpushpostbot/32/4370_2.png) [@SDLPushPostBot](https://discourse.libsdl.org/u/SDLPushPostBot)\
**Post date:** [August 4, 2023, 1:37am UTC](https://discourse.libsdl.org/t/sdl-audio-fixed-incorrect-assertion/45314/1 "2023-08-04T01:37:14Z")

</div>

[https://github.com/libsdl-org/SDL/commit/be0dc630b7eb80f9fb5d18686c68bcd5b949c273](https://github.com/libsdl-org/SDL/commit/be0dc630b7eb80f9fb5d18686c68bcd5b949c273)

```diff
From be0dc630b7eb80f9fb5d18686c68bcd5b949c273 Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Tue, 11 Jul 2023 21:55:55 -0400
Subject: [PATCH] audio: Fixed incorrect assertion

---
 src/audio/SDL_audio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c
index cdf7a164aca7..5224cb067ef1 100644
--- a/src/audio/SDL_audio.c
+++ b/src/audio/SDL_audio.c
@@ -1019,7 +1019,7 @@ SDL_AudioDevice *SDL_FindPhysicalAudioDeviceByCallback(SDL_bool (*callback)(SDL_
         SDL_SetError("Device not found");
     }
 
- SDL_assert(!SDL_AtomicGet(&dev->condemned)); // shouldn't be in the list if pending deletion.
+ SDL_assert(!dev || !SDL_AtomicGet(&dev->condemned)); // shouldn't be in the list if pending deletion.
 
     return dev;
 }

```
