Fix query node crash when retrieved 0 result (#6087)

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
pull/6092/head
congqixia 2021-06-24 19:04:34 +08:00 committed by GitHub
parent 56bd434696
commit 10e5fc3382
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -1286,6 +1286,14 @@ func mergeRetrieveResults(dataArr []*segcorepb.RetrieveResults) (*segcorepb.Retr
}
}
// not found, return default values indicating not result found
if final == nil {
final = &segcorepb.RetrieveResults{
Ids: nil,
FieldsData: []*schemapb.FieldData{},
}
}
return final, nil
}