sipcall: check media_tr

avoid segfault. Backtrace from the play store

Change-Id: I5a44a5ee190cba22ed31ef4c7f64703b352db7fe
This commit is contained in:
Sébastien Blin
2020-11-09 14:32:35 -05:00
parent 775dbedb1c
commit 891f29c37d

View File

@ -1034,9 +1034,13 @@ SIPCall::setupLocalSDPFromIce()
std::vector<IceCandidate>
SIPCall::getAllRemoteCandidates()
{
std::vector<IceCandidate> rem_candidates;
auto media_tr = getIceMediaTransport();
if (not media_tr) {
JAMI_WARN("[call:%s] no media ICE transport", getCallId().c_str());
return {};
}
auto addSDPCandidates = [&, this](unsigned sdpMediaId, std::vector<IceCandidate>& out) {
IceCandidate cand;
for (auto& line : sdp_->getIceCandidates(sdpMediaId)) {
@ -1049,6 +1053,7 @@ SIPCall::getAllRemoteCandidates()
}
};
std::vector<IceCandidate> rem_candidates;
addSDPCandidates(SDP_AUDIO_MEDIA_ID, rem_candidates);
#ifdef ENABLE_VIDEO
addSDPCandidates(SDP_VIDEO_MEDIA_ID, rem_candidates);