Check for not nil ICECandidatePair (#1253)
GetSelectedICECandidatePair can return nil for the candidate pair if not available even if the error is not nil. Protect against the nil de-reference panic.
This commit is contained in:
@@ -970,7 +970,7 @@ func (t *PCTransport) GetICEConnectionType() types.ICEConnectionType {
|
|||||||
return unknown
|
return unknown
|
||||||
}
|
}
|
||||||
p, err := t.getSelectedPair()
|
p, err := t.getSelectedPair()
|
||||||
if err != nil {
|
if err != nil || p == nil {
|
||||||
return unknown
|
return unknown
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user