From cef5c6115fbe38280dcf1da5db6f4da533ecf117 Mon Sep 17 00:00:00 2001 From: Alex Anderson Date: Sun, 28 Nov 2021 14:05:55 -0800 Subject: [PATCH] patch: add a null check for something that should never happen --- src/asio-input.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/asio-input.cpp b/src/asio-input.cpp index d8d0049..911db1c 100644 --- a/src/asio-input.cpp +++ b/src/asio-input.cpp @@ -348,6 +348,10 @@ class AudioCB : public juce::AudioIODeviceCallback { void audioDeviceAboutToStart(juce::AudioIODevice *device) { + if (device == nullptr) { + blog(LOG_INFO, "Attempting to start a device (nullptr)? This should never happen"); + return; + } blog(LOG_INFO, "Starting (%s)", device->getName().toStdString().c_str()); juce::String name = device->getName(); sample_rate = device->getCurrentSampleRate();