Fix nil pointer access (#23919)

Signed-off-by: Enwei Jiao <enwei.jiao@zilliz.com>
pull/23930/head
Enwei Jiao 2023-05-08 10:08:39 +08:00 committed by GitHub
parent e13d900398
commit 240c5625cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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]