From 7da33786d18a40324b3fee0647396cbd0989e26c Mon Sep 17 00:00:00 2001 From: Christophe Deschamps Date: Wed, 4 Sep 2024 11:16:13 +0200 Subject: [PATCH] Set a default account when removing the default account --- Linphone/model/core/CoreModel.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Linphone/model/core/CoreModel.cpp b/Linphone/model/core/CoreModel.cpp index a95135cc7..51a3ec517 100644 --- a/Linphone/model/core/CoreModel.cpp +++ b/Linphone/model/core/CoreModel.cpp @@ -225,6 +225,8 @@ void CoreModel::onAccountAdded(const std::shared_ptr &core, } void CoreModel::onAccountRemoved(const std::shared_ptr &core, const std::shared_ptr &account) { + if (core->getDefaultAccount() == nullptr && core->getAccountList().size() > 0) + core->setDefaultAccount(core->getAccountList().front()); emit accountRemoved(core, account); } void CoreModel::onAccountRegistrationStateChanged(const std::shared_ptr &core,