fix crash when no call associated to conference

This commit is contained in:
Gaelle Braud 2026-02-24 17:20:54 +01:00
parent cef5a85d63
commit 1fddae5deb

View file

@ -154,11 +154,16 @@ void ConferenceModel::toggleScreenSharing() {
: linphone::MediaDirection::SendOnly); : linphone::MediaDirection::SendOnly);
} }
if (params->isValid()) { if (params->isValid()) {
lInfo() << log() if (mMonitor->getCall()) {
.arg("Toggling screen sharing %1, direction=%2") mMonitor->getCall()->update(params);
.arg(enable) lInfo() << log()
.arg((int)params->getVideoDirection()); .arg("Toggling screen sharing %1, direction=%2")
mMonitor->getCall()->update(params); .arg(enable)
.arg((int)params->getVideoDirection());
} else {
lCritical() << log().arg(
"Cannot toggle screen sharing because call associated to this conference is null");
}
} else lCritical() << log().arg("Cannot toggle screen sharing because parameters are invalid"); } else lCritical() << log().arg("Cannot toggle screen sharing because parameters are invalid");
} }
} }