Commit f9e1dd5d authored by Stepan Salenikovich's avatar Stepan Salenikovich Committed by Guillaume Roguez

manager: prevent nullptr access of audiodriver

The rest of the audio api performs this check as well.

Change-Id: I31d589f2f634e2044ce1c7ca8ab614b2caef4d7b
Reviewed-by: Guillaume Roguez's avatarGuillaume Roguez <guillaume.roguez@savoirfairelinux.com>
parent e55d57c5
......@@ -2229,6 +2229,12 @@ std::vector<std::string>
Manager::getAudioOutputDeviceList()
{
std::lock_guard<std::mutex> lock(pimpl_->audioLayerMutex_);
if (not pimpl_->audiodriver_) {
RING_ERR("Audio layer not initialized");
return {};
}
return pimpl_->audiodriver_->getPlaybackDeviceList();
}
......@@ -2239,6 +2245,12 @@ std::vector<std::string>
Manager::getAudioInputDeviceList()
{
std::lock_guard<std::mutex> lock(pimpl_->audioLayerMutex_);
if (not pimpl_->audiodriver_) {
RING_ERR("Audio layer not initialized");
return {};
}
return pimpl_->audiodriver_->getCaptureDeviceList();
}
......@@ -2250,6 +2262,11 @@ Manager::getCurrentAudioDevicesIndex()
{
std::lock_guard<std::mutex> lock(pimpl_->audioLayerMutex_);
if (not pimpl_->audiodriver_) {
RING_ERR("Audio layer not initialized");
return {};
}
std::vector<std::string> v;
std::stringstream ssi, sso, ssr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment