fix: [2.5] Check if ArrayData is nil to prevent panic (#44333)

issue: #44331 
master pr: #44332

Signed-off-by: Cai Zhang <cai.zhang@zilliz.com>
This commit is contained in:
cai.zhang 2025-09-12 14:47:59 +08:00 committed by GitHub
parent ec4442d39b
commit 4c0249ba20
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1120,7 +1120,7 @@ func fillFieldPropertiesBySchema(columns []*schemapb.FieldData, schema *schemapb
// Set the ElementType because it may not be set in the insert request.
if fieldData.Type == schemapb.DataType_Array {
fd, ok := fieldData.Field.(*schemapb.FieldData_Scalars)
if !ok {
if !ok || fd.Scalars.GetArrayData() == nil {
return fmt.Errorf("field convert FieldData_Scalars fail in fieldData, fieldName: %s,"+
" collectionName:%s", fieldData.FieldName, schema.Name)
}