diff --git a/src/media/audio/alsa/alsalayer.cpp b/src/media/audio/alsa/alsalayer.cpp
index b8f91d75ef0e3708268140ee2bc8e1c7f36ce7cc..9ee2906a779367ed773f56bf1e01dcb36d57c0f0 100644
--- a/src/media/audio/alsa/alsalayer.cpp
+++ b/src/media/audio/alsa/alsalayer.cpp
@@ -183,7 +183,7 @@ bool AlsaLayer::openDevice(snd_pcm_t **pcm, const std::string &dev, snd_pcm_stre
         if (err == -EBUSY) {
             // We're called in audioThread_ context, so if exit is requested
             // force return now
-            if (not audioThread_->isRunning())
+            if ((not audioThread_) or (not audioThread_->isRunning()))
                 return false;
             std::this_thread::sleep_for(std::chrono::milliseconds(100));
         }