diff --git a/revid/senders.go b/revid/senders.go index 0cb61ee8..4a8e2db8 100644 --- a/revid/senders.go +++ b/revid/senders.go @@ -391,11 +391,12 @@ func (s *rtpSender) load(c *ring.Chunk) error { func (s *rtpSender) send(d []byte) error { var err error - if d != nil { + switch { + case d != nil: _, err = s.encoder.Write(d) - } else if s.chunk != nil { + case s.chunk != nil: _, err = s.chunk.WriteTo(s.encoder) - } else { + default: err = errors.New("no data provided, but rtpSender chunk is empty") } return err