Fix crash in contact creation with no SIP address

This commit is contained in:
Christophe Deschamps 2025-01-30 11:58:16 +01:00
parent d74ccc32bd
commit 5c9ab21356

View file

@ -385,7 +385,8 @@ VariantObject *Utils::findFriendByAddress(const QString &address) {
});
// Rebuild friend if needed
auto updateValue = [data, address](const std::shared_ptr<linphone::Friend> &f) -> void {
if (f->getAddress()->weakEqual(ToolModel::interpretUrl(address))) data->invokeRequestValue();
if (f && f->getAddress() && f->getAddress()->weakEqual(ToolModel::interpretUrl(address)))
data->invokeRequestValue();
};
data->makeUpdateCond(CoreModel::getInstance().get(), &CoreModel::friendCreated, updateValue); // New Friend
data->makeUpdateCond(CoreModel::getInstance().get(), &CoreModel::friendRemoved, updateValue); // New Friend