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:
Raja Subramanian
2022-12-22 11:28:04 +05:30
committed by GitHub
parent eea592a1f5
commit 4fbb89e99c
+1 -1
View File
@@ -970,7 +970,7 @@ func (t *PCTransport) GetICEConnectionType() types.ICEConnectionType {
return unknown
}
p, err := t.getSelectedPair()
if err != nil {
if err != nil || p == nil {
return unknown
}