aboutsummaryrefslogtreecommitdiff
path: root/go/storage/needle_byte_cache.go
diff options
context:
space:
mode:
Diffstat (limited to 'go/storage/needle_byte_cache.go')
-rw-r--r--go/storage/needle_byte_cache.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/go/storage/needle_byte_cache.go b/go/storage/needle_byte_cache.go
index d39ed23c4..5db0f8895 100644
--- a/go/storage/needle_byte_cache.go
+++ b/go/storage/needle_byte_cache.go
@@ -66,7 +66,9 @@ func getBytesForFileBlock(r *os.File, offset int64, readSize int) (dataSlice []b
}
func (n *Needle) ReleaseMemory() {
- n.rawBlock.decreaseReference()
+ if n.rawBlock != nil {
+ n.rawBlock.decreaseReference()
+ }
}
func ReleaseBytes(b []byte) {
bytesPool.Put(b)