From 240c5625cdd416acb297b1ff7a1a90af1237f83d Mon Sep 17 00:00:00 2001 From: Enwei Jiao Date: Mon, 8 May 2023 10:08:39 +0800 Subject: [PATCH] Fix nil pointer access (#23919) Signed-off-by: Enwei Jiao --- internal/querycoordv2/checkers/balance_checker.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/querycoordv2/checkers/balance_checker.go b/internal/querycoordv2/checkers/balance_checker.go index 2e08b9f879..600525e0d2 100644 --- a/internal/querycoordv2/checkers/balance_checker.go +++ b/internal/querycoordv2/checkers/balance_checker.go @@ -64,7 +64,7 @@ func (b *BalanceChecker) replicasToBalance() []int64 { // all replicas belonging to loading collection will be skipped loadedCollections := lo.Filter(ids, func(cid int64, _ int) bool { collection := b.meta.GetCollection(cid) - return collection != nil && b.meta.GetCollection(cid).Status == querypb.LoadStatus_Loaded + return collection != nil && collection.Status == querypb.LoadStatus_Loaded }) sort.Slice(loadedCollections, func(i, j int) bool { return loadedCollections[i] < loadedCollections[j]