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

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

Signed-off-by: yah01 <yang.cen@zilliz.com>
pull/20830/head
yah01 2022-11-25 10:45:12 +08:00 committed by GitHub
parent 37725d3470
commit 882ba6240b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -379,7 +379,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()))