From 62d416bf4fad23f3c930f4dafeb4bb898ad01fbe Mon Sep 17 00:00:00 2001 From: "cai.zhang" Date: Fri, 12 Sep 2025 14:17:57 +0800 Subject: [PATCH] fix: Check if ArrayData is nil to prevent panic (#44332) issue: #44331 Signed-off-by: Cai Zhang --- internal/proxy/util.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/proxy/util.go b/internal/proxy/util.go index 46749c33e8..02bc810d8b 100644 --- a/internal/proxy/util.go +++ b/internal/proxy/util.go @@ -1186,14 +1186,14 @@ 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) } fd.Scalars.GetArrayData().ElementType = fieldSchema.ElementType } else if fieldData.Type == schemapb.DataType_ArrayOfVector { fd, ok := fieldData.Field.(*schemapb.FieldData_Vectors) - if !ok { + if !ok || fd.Vectors.GetVectorArray() == nil { return fmt.Errorf("field convert FieldData_Vectors fail in fieldData, fieldName: %s,"+ " collectionName:%s", fieldData.FieldName, schema.Name) }