From 964a9568d962237656b0143002c28f30d6942627 Mon Sep 17 00:00:00 2001 From: YouROK <8yourok8@mail.ru> Date: Tue, 16 Feb 2021 21:07:34 +0300 Subject: [PATCH] fix buffer crash --- src/server/torr/storage/torrstor/buffer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/torr/storage/torrstor/buffer.go b/src/server/torr/storage/torrstor/buffer.go index 8373c9f..bfeae4e 100644 --- a/src/server/torr/storage/torrstor/buffer.go +++ b/src/server/torr/storage/torrstor/buffer.go @@ -61,7 +61,7 @@ func (b *BufferPool) GetBuffer(p *Piece) (buff []byte, index int) { } func (b *BufferPool) ReleaseBuffer(index int) { - if index == -1 { + if index == -1 || b == nil { return } b.mu.Lock()