diff --git a/plugins/systemvolume/systemvolumeplugin-win.cpp b/plugins/systemvolume/systemvolumeplugin-win.cpp index 30dd407f6..db8941ac9 100644 --- a/plugins/systemvolume/systemvolumeplugin-win.cpp +++ b/plugins/systemvolume/systemvolumeplugin-win.cpp @@ -262,9 +262,19 @@ bool SystemvolumePlugin::sendSinkList() unsigned int deviceCount; devices->GetCount(&deviceCount); + if (!deviceCount) { + qWarning("No audio devices detected"); + return false; + } + IMMDevice *defaultDevice = nullptr; deviceEnumerator->GetDefaultAudioEndpoint(eRender, eMultimedia, &defaultDevice); + if (!defaultDevice) { + qWarning("No default audio device detected"); + return false; + } + LPWSTR defaultId = NULL; defaultDevice->GetId(&defaultId);