Skip to content

Commit 6083025

Browse files
committed
attemp to fix a crash with wake from sleep
1 parent a2dbbba commit 6083025

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Project-Aurora/Project-Aurora/Modules/AudioCapture/AudioDeviceProxy.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,10 @@ private void SetDevice([CanBeNull] MMDevice mmDevice)
127127
{
128128
// Get a WaveIn from the device and start it, adding any events as requied
129129
WaveIn = Flow == DataFlow.Render ? new WasapiLoopbackCapture(mmDevice) : new WasapiCapture(mmDevice);
130-
WaveIn.DataAvailable += _waveInDataAvailable;
130+
if (_waveInDataAvailable != null)
131+
{
132+
WaveIn.DataAvailable += _waveInDataAvailable;
133+
}
131134
WaveIn.RecordingStopped += WaveInOnRecordingStopped;
132135

133136
//"Activate" device

0 commit comments

Comments
 (0)