From a776163adb0c23b8b2cf1982464a659602fbf435 Mon Sep 17 00:00:00 2001 From: roseduan Date: Sun, 3 Mar 2024 17:48:35 +0800 Subject: [PATCH] fix index Less panic --- CHANGELOG.md | 4 ++++ index/btree.go | 3 +++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cf00f1c1..0bf3d737 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# Release 2.3.5(2024-03-03) +## 🐞 Bug Fixes +* Fix index Less function panic. + # Release 2.3.4(2024-01-07) ## 🎄 Enhancements diff --git a/index/btree.go b/index/btree.go index ed117672..6120ffaa 100644 --- a/index/btree.go +++ b/index/btree.go @@ -28,6 +28,9 @@ func newBTree() *MemoryBTree { } func (it *item) Less(bi btree.Item) bool { + if bi == nil { + return false + } return bytes.Compare(it.key, bi.(*item).key) < 0 }