From 351ae8c864370239505e8c772ed91242600846dd Mon Sep 17 00:00:00 2001 From: LouisKim Date: Mon, 17 Apr 2023 16:45:20 +0900 Subject: [PATCH] Return nil when buffer is not initialized --- pkg/jitter/packet_buffer.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/jitter/packet_buffer.go b/pkg/jitter/packet_buffer.go index 237c397..8ecf783 100644 --- a/pkg/jitter/packet_buffer.go +++ b/pkg/jitter/packet_buffer.go @@ -55,5 +55,9 @@ func (p *PacketBuffer) Get() ([]byte, bool, int64) { p.Lock() defer p.Unlock() + if p.buffer == nil { + return nil, false, 0 + } + return p.buffer.Get() }