Skip to content

Commit 026e59a

Browse files
committed
Handle errors to prevent panic
Signed-off-by: Cai Zhang <cai.zhang@zilliz.com>
1 parent 86c57dc commit 026e59a

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

arrow/cdata/cdata.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,9 @@ func (imp *cimporter) doImportChildren() error {
407407
st := imp.dt.(*arrow.StructType)
408408
for i, c := range children {
409409
imp.children[i].dt = st.Field(i).Type
410-
imp.children[i].importChild(imp, c)
410+
if err := imp.children[i].importChild(imp, c); err != nil {
411+
return err
412+
}
411413
}
412414
case arrow.RUN_END_ENCODED: // import run-ends and values
413415
st := imp.dt.(*arrow.RunEndEncodedType)
@@ -428,13 +430,17 @@ func (imp *cimporter) doImportChildren() error {
428430
dt := imp.dt.(*arrow.DenseUnionType)
429431
for i, c := range children {
430432
imp.children[i].dt = dt.Fields()[i].Type
431-
imp.children[i].importChild(imp, c)
433+
if err := imp.children[i].importChild(imp, c); err != nil {
434+
return err
435+
}
432436
}
433437
case arrow.SPARSE_UNION:
434438
dt := imp.dt.(*arrow.SparseUnionType)
435439
for i, c := range children {
436440
imp.children[i].dt = dt.Fields()[i].Type
437-
imp.children[i].importChild(imp, c)
441+
if err := imp.children[i].importChild(imp, c); err != nil {
442+
return err
443+
}
438444
}
439445
}
440446

0 commit comments

Comments
 (0)