Check whether CodecIndex is nil to avoid panic (#20816) (#20826)

Signed-off-by: yah01 <yang.cen@zilliz.com>

Signed-off-by: yah01 <yang.cen@zilliz.com>

Signed-off-by: yah01 <yang.cen@zilliz.com>
pull/20699/head
yah01 2022-11-25 14:55:12 +08:00 committed by GitHub
parent 0c49a1fe87
commit f19740fdac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -374,7 +374,7 @@ func (it *indexBuildTask) BuildDiskAnnIndex(ctx context.Context) error {
return nil, nil
}).Await()
if err != nil {
if it.index.CleanLocalData() != nil {
if it.index != nil && it.index.CleanLocalData() != nil {
log.Ctx(ctx).Error("failed to clean cached data on disk after build index failed",
zap.Int64("buildID", it.BuildID),
zap.Int64("index version", it.req.GetIndexVersion()))