From e04633e94d4d489a03afabb58d7a5035ea302866 Mon Sep 17 00:00:00 2001 From: Juniper Hovey Date: Thu, 7 Sep 2023 13:52:08 -0500 Subject: [PATCH] Fix panic on startup --- base/search/ivf.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/base/search/ivf.go b/base/search/ivf.go index f362e3f14..4ddd784b8 100644 --- a/base/search/ivf.go +++ b/base/search/ivf.go @@ -215,6 +215,9 @@ func (idx *IVF) Build(_ context.Context) { nextDistance = d } } + if nextCluster == -1 { + return nil + } if nextCluster != assignments[i] { errorCount.Inc() }