ensuare onPacket is not nil in rtcpreader callback (#1390)
This commit is contained in:
@@ -22,7 +22,7 @@ func (r *RTCPReader) Write(p []byte) (n int, err error) {
|
||||
err = io.EOF
|
||||
return
|
||||
}
|
||||
if f, ok := r.onPacket.Load().(func([]byte)); ok {
|
||||
if f, ok := r.onPacket.Load().(func([]byte)); ok && f != nil {
|
||||
f(p)
|
||||
}
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user