summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-09-29 20:24:44 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-09-29 20:24:44 (GMT)
commit0f752eb381b44182e048c39e621fba552c2179f0 (patch)
tree812b7c2801bf3698df0f951efa3bc4ec39f6e95b /Swiften/FileTransfer/DefaultLocalJingleTransportCandidateGenerator.cpp
parenteb25d910e7991503eaa74233f0b396648f512e88 (diff)
downloadswift-0f752eb381b44182e048c39e621fba552c2179f0.zip
swift-0f752eb381b44182e048c39e621fba552c2179f0.tar.bz2
Work around FT crash when proxies are available.
Diffstat (limited to 'Swiften/FileTransfer/DefaultLocalJingleTransportCandidateGenerator.cpp')
-rw-r--r--Swiften/FileTransfer/DefaultLocalJingleTransportCandidateGenerator.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/Swiften/FileTransfer/DefaultLocalJingleTransportCandidateGenerator.cpp b/Swiften/FileTransfer/DefaultLocalJingleTransportCandidateGenerator.cpp
index 5b6da4c..4b205cb 100644
--- a/Swiften/FileTransfer/DefaultLocalJingleTransportCandidateGenerator.cpp
+++ b/Swiften/FileTransfer/DefaultLocalJingleTransportCandidateGenerator.cpp
@@ -67,13 +67,15 @@ void DefaultLocalJingleTransportCandidateGenerator::generateLocalTransportCandid
// get proxy candidates
std::vector<S5BProxyRequest::ref> proxyCandidates = s5bProxy->getS5BProxies();
foreach(S5BProxyRequest::ref proxy, proxyCandidates) {
- JingleS5BTransportPayload::Candidate candidate;
- candidate.type = JingleS5BTransportPayload::Candidate::ProxyType;
- candidate.jid = proxy->getStreamHost().get().jid;
- candidate.hostPort = proxy->getStreamHost().get().addressPort;
- candidate.priority = 65536 * 10 + localPreference;
- candidate.cid = idGenerator.generateID();
- payL->addCandidate(candidate);
+ if (proxy->getStreamHost()) { // FIXME: Added this test, because there were cases where this wasn't initialized. Investigate this. (Remko)
+ JingleS5BTransportPayload::Candidate candidate;
+ candidate.type = JingleS5BTransportPayload::Candidate::ProxyType;
+ candidate.jid = (*proxy->getStreamHost()).jid;
+ candidate.hostPort = (*proxy->getStreamHost()).addressPort;
+ candidate.priority = 65536 * 10 + localPreference;
+ candidate.cid = idGenerator.generateID();
+ payL->addCandidate(candidate);
+ }
}
onLocalTransportCandidatesGenerated(payL);