Fix a crash when starting the application without accounts.

This commit is contained in:
Julien Wadel 2022-08-22 12:43:29 +02:00
parent 0794293a69
commit 8f42422ee3
2 changed files with 4 additions and 4 deletions

View file

@ -92,13 +92,13 @@ CoreManager::~CoreManager(){
void CoreManager::initCoreManager(){
qInfo() << "Init CoreManager";
mAccountSettingsModel = new AccountSettingsModel(this);
mSettingsModel = new SettingsModel(this);
mCallsListModel = new CallsListModel(this);
mChatModel = new ChatModel(this);
mContactsListModel = new ContactsListModel(this);
mContactsImporterListModel = new ContactsImporterListModel(this);
mAccountSettingsModel = new AccountSettingsModel(this);
mLdapListModel = new LdapListModel(this);
mSettingsModel = new SettingsModel(this);
mSipAddressesModel = new SipAddressesModel(this);
mEventCountNotifier = new EventCountNotifier(this);
mTimelineListModel = new TimelineListModel(this);

View file

@ -832,7 +832,7 @@ void SettingsModel::setSecureChatEnabled (bool status) {
}
bool SettingsModel::getGroupChatEnabled() const{
return !CoreManager::getInstance()->getCore()->getDefaultAccount()->getParams()->getConferenceFactoryUri().empty();
return CoreManager::getInstance()->getCore()->getDefaultAccount() && !CoreManager::getInstance()->getCore()->getDefaultAccount()->getParams()->getConferenceFactoryUri().empty();
}
// -----------------------------------------------------------------------------
@ -872,7 +872,7 @@ void SettingsModel::setConferenceEnabled (bool status) {
}
bool SettingsModel::getVideoConferenceEnabled() const{
return !!CoreManager::getInstance()->getCore()->getDefaultAccount()->getParams()->getAudioVideoConferenceFactoryAddress();
return CoreManager::getInstance()->getCore()->getDefaultAccount() && !!CoreManager::getInstance()->getCore()->getDefaultAccount()->getParams()->getAudioVideoConferenceFactoryAddress();
}
// -----------------------------------------------------------------------------