Skip to content
Snippets Groups Projects
Commit ec0a166d authored by Ming Rui Zhang's avatar Ming Rui Zhang
Browse files

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

Change-Id: I657d8b3793399b4a1f1819303c93684577743ada
parent 9d0011fe
No related branches found
No related tags found
No related merge requests found
...@@ -1277,7 +1277,8 @@ SettingsWidget::populateVideoSettings() ...@@ -1277,7 +1277,8 @@ SettingsWidget::populateVideoSettings()
} }
ui->deviceBox->setCurrentIndex(deviceIndex); ui->deviceBox->setCurrentIndex(deviceIndex);
setFormatListForDevice(LRCInstance::avModel().getCurrentVideoCaptureDevice()); setFormatListForDevice(LRCInstance::avModel().getCurrentVideoCaptureDevice());
try
{
bool isSIP = LRCInstance::getCurrentAccountInfo().profileInfo.type == lrc::api::profile::Type::SIP; bool isSIP = LRCInstance::getCurrentAccountInfo().profileInfo.type == lrc::api::profile::Type::SIP;
auto photoBooth = isSIP ? ui->currentSIPAccountAvatar : ui->currentAccountAvatar; auto photoBooth = isSIP ? ui->currentSIPAccountAvatar : ui->currentAccountAvatar;
...@@ -1285,6 +1286,7 @@ SettingsWidget::populateVideoSettings() ...@@ -1285,6 +1286,7 @@ SettingsWidget::populateVideoSettings()
selectedMenu_ == SettingsMenu::Media) { selectedMenu_ == SettingsMenu::Media) {
startPreviewing(false); startPreviewing(false);
} }
} catch (...) {}
} }
connect(ui->deviceBox, QOverload<int>::of(&QComboBox::currentIndexChanged), connect(ui->deviceBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment