Panic fix for nil candidate check. (#2957)

This commit is contained in:
Raja Subramanian
2024-08-25 10:12:32 +05:30
committed by GitHub
parent 56e67c9d25
commit e9f26c21e7
+5
View File
@@ -345,5 +345,10 @@ func IsCandidateMDNS(candidate webrtc.ICECandidateInit) bool {
}
func IsICECandidateMDNS(candidate ice.Candidate) bool {
if candidate == nil {
// end-of-candidates candidate
return false
}
return strings.HasSuffix(candidate.Address(), ".local")
}