Fixes a NullPointerException in the case of relayed candidates.
This commit is contained in:
parent
c859509daa
commit
f57ba6870e
@ -45,15 +45,23 @@ public class FoundationsRegistry
|
|||||||
public void assignFoundation(Candidate candidate)
|
public void assignFoundation(Candidate candidate)
|
||||||
{
|
{
|
||||||
//create the foundation key String
|
//create the foundation key String
|
||||||
String type = candidate.getType().toString();
|
CandidateType candidateType = candidate.getType();
|
||||||
|
String type = candidateType.toString();
|
||||||
String base
|
String base
|
||||||
= candidate.getBase().getTransportAddress().getHostAddress();
|
= candidate.getBase().getTransportAddress().getHostAddress();
|
||||||
String server = null;
|
String server;
|
||||||
|
|
||||||
if(candidate.getType() == CandidateType.SERVER_REFLEXIVE_CANDIDATE
|
switch (candidateType)
|
||||||
|| candidate.getType() == CandidateType.RELAYED_CANDIDATE)
|
|
||||||
{
|
{
|
||||||
|
case SERVER_REFLEXIVE_CANDIDATE:
|
||||||
server = candidate.getStunServerAddress().getHostAddress();
|
server = candidate.getStunServerAddress().getHostAddress();
|
||||||
|
break;
|
||||||
|
case RELAYED_CANDIDATE:
|
||||||
|
server = candidate.getTurnServerAddress().getHostAddress();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
server = null;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
String transport = candidate.getTransport().toString();
|
String transport = candidate.getTransport().toString();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user