From ccb42d00b7e8f425d3274af7aafa512e4b11276f Mon Sep 17 00:00:00 2001 From: yunjieguo Date: Fri, 10 Feb 2023 17:27:46 +0800 Subject: [PATCH] check dtls --- sdpinfo.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sdpinfo.go b/sdpinfo.go index 9e20bc8..1c84228 100644 --- a/sdpinfo.go +++ b/sdpinfo.go @@ -385,12 +385,14 @@ func (s *SDPInfo) String() string { mediaMap.IceUfrag = s.GetICE().GetUfrag() mediaMap.IcePwd = s.GetICE().GetPassword() - mediaMap.Fingerprint = &transform.FingerprintStruct{ - Type: s.GetDTLS().GetHash(), - Hash: s.GetDTLS().GetFingerprint(), - } + if s.GetDTLS() != nil { + mediaMap.Fingerprint = &transform.FingerprintStruct{ + Type: s.GetDTLS().GetHash(), + Hash: s.GetDTLS().GetFingerprint(), + } - mediaMap.Setup = s.GetDTLS().GetSetup().String() + mediaMap.Setup = s.GetDTLS().GetSetup().String() + } for _, codec := range media.GetCodecs() {