Commit ec0a166d authored by Ming Rui Zhang's avatar Ming Rui Zhang

settingswidget: prevent crash when video device events happen with no account

Change-Id: I657d8b3793399b4a1f1819303c93684577743ada
parent 9d0011fe
......@@ -1277,14 +1277,16 @@ SettingsWidget::populateVideoSettings()
}
ui->deviceBox->setCurrentIndex(deviceIndex);
setFormatListForDevice(LRCInstance::avModel().getCurrentVideoCaptureDevice());
bool isSIP = LRCInstance::getCurrentAccountInfo().profileInfo.type == lrc::api::profile::Type::SIP;
auto photoBooth = isSIP ? ui->currentSIPAccountAvatar : ui->currentAccountAvatar;
if ( (photoBooth->isVisible() && LRCInstance::renderer()->isPreviewing()) ||
selectedMenu_ == SettingsMenu::Media) {
startPreviewing(false);
}
try
{
bool isSIP = LRCInstance::getCurrentAccountInfo().profileInfo.type == lrc::api::profile::Type::SIP;
auto photoBooth = isSIP ? ui->currentSIPAccountAvatar : ui->currentAccountAvatar;
if ((photoBooth->isVisible() && LRCInstance::renderer()->isPreviewing()) ||
selectedMenu_ == SettingsMenu::Media) {
startPreviewing(false);
}
} catch (...) {}
}
connect(ui->deviceBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
......
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