Skip to content

Commit

Permalink
fix: rtcp interceptor nil panic
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeTeng2001 authored and Sean-Der committed Feb 12, 2025
1 parent 1c45355 commit e057683
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rtpreceiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,9 @@ func (r *RTPReceiver) streamsForTrack(t *TrackRemote) *trackStreams {
func (r *RTPReceiver) readRTP(b []byte, reader *TrackRemote) (n int, a interceptor.Attributes, err error) {
<-r.received
if t := r.streamsForTrack(reader); t != nil {
if t.rtcpInterceptor == nil {
return 0, nil, nil
}

Check warning on line 411 in rtpreceiver.go

View check run for this annotation

Codecov / codecov/patch

rtpreceiver.go#L410-L411

Added lines #L410 - L411 were not covered by tests
return t.rtpInterceptor.Read(b, a)

Check failure on line 412 in rtpreceiver.go

View workflow job for this annotation

GitHub Actions / lint / Go

return with no blank line before (nlreturn)
}

Expand Down

0 comments on commit e057683

Please sign in to comment.