revid: checking that we have more than 0 destinations before we write to the ring buffer

This commit is contained in:
Saxon 2019-03-02 13:08:48 +10:30
parent 7619f5b921
commit 5dd3045db2
1 changed files with 4 additions and 0 deletions

View File

@ -142,6 +142,10 @@ func (p *packer) Write(frame []byte) (int, error) {
return len(frame), nil
}
if len(p.owner.destination) == 0 {
panic("must have at least 1 destination")
}
n, err := p.owner.buffer.Write(frame)
if err != nil {
if err == ring.ErrDropped {