Fix has collection err (#14089)

Signed-off-by: xiaofan-luan <xiaofan.luan@zilliz.com>
pull/14123/head
Xiaofan 2021-12-23 21:46:10 +08:00 committed by GitHub
parent b5f0dee1dd
commit 24e2faf110
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -2472,13 +2472,16 @@ func (hct *hasCollectionTask) PreExecute(ctx context.Context) error {
func (hct *hasCollectionTask) Execute(ctx context.Context) error {
var err error
hct.result, err = hct.rootCoord.HasCollection(ctx, hct.HasCollectionRequest)
if err != nil {
return err
}
if hct.result == nil {
return errors.New("has collection resp is nil")
}
if hct.result.Status.ErrorCode != commonpb.ErrorCode_Success {
return errors.New(hct.result.Status.Reason)
}
return err
return nil
}
func (hct *hasCollectionTask) PostExecute(ctx context.Context) error {