diff --git a/src/modules/audio_device/main/source/win/audio_device_core_win.cc b/src/modules/audio_device/main/source/win/audio_device_core_win.cc index ab752b681..865cb6c54 100644 --- a/src/modules/audio_device/main/source/win/audio_device_core_win.cc +++ b/src/modules/audio_device/main/source/win/audio_device_core_win.cc @@ -4160,15 +4160,18 @@ Exit: if (keepRecording) { - hr = _ptrClientIn->Stop(); - if (FAILED(hr)) + if (_ptrClientIn != NULL) { - _TraceCOMError(hr); - } - hr = _ptrClientIn->Reset(); - if (FAILED(hr)) - { - _TraceCOMError(hr); + hr = _ptrClientIn->Stop(); + if (FAILED(hr)) + { + _TraceCOMError(hr); + } + hr = _ptrClientIn->Reset(); + if (FAILED(hr)) + { + _TraceCOMError(hr); + } } // Trigger callback from module process thread