diff --git a/revid/senders.go b/revid/senders.go index eab8af7c..c601bfec 100644 --- a/revid/senders.go +++ b/revid/senders.go @@ -29,6 +29,7 @@ LICENSE package revid import ( + "errors" "fmt" "io" "net" @@ -392,13 +393,12 @@ func (s *rtpSender) send(d []byte) error { var err error if d != nil { _, err = s.encoder.Write(d) - } else { + } else if s.chunk != nil { _, err = s.chunk.WriteTo(s.encoder) + } else { + err = errors.New("no data provided, but rtpSender chunk is empty") } - if err != nil { - return err - } - return nil + return err } func (s *rtpSender) release() {