diff --git a/Vocaluxe/Lib/Sound/CPortAudioHandle.cs b/Vocaluxe/Lib/Sound/CPortAudioHandle.cs index a8fe8e89..d8ce237e 100644 --- a/Vocaluxe/Lib/Sound/CPortAudioHandle.cs +++ b/Vocaluxe/Lib/Sound/CPortAudioHandle.cs @@ -176,6 +176,11 @@ namespace Vocaluxe.Lib.Sound try { + if (stream == IntPtr.Zero) + { + CLog.Debug("Stream is null, skipping close."); + return; + } PortAudio.Pa_CloseStream(stream); } catch (Exception ex) @@ -235,4 +240,4 @@ namespace Vocaluxe.Lib.Sound return selectedHostApi; } } -} \ No newline at end of file +}