From b2a9bb1e364552f415b20dc8ec809b085ef55b40 Mon Sep 17 00:00:00 2001 From: Felipe Pena Date: Sun, 10 Nov 2024 17:02:23 -0300 Subject: [PATCH] fix --- vlib/v/gen/c/orm.v | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vlib/v/gen/c/orm.v b/vlib/v/gen/c/orm.v index b64eb9403afcca..a7f5dccc524af9 100644 --- a/vlib/v/gen/c/orm.v +++ b/vlib/v/gen/c/orm.v @@ -319,7 +319,9 @@ fn (mut g Gen) write_orm_insert_with_last_ids(node ast.SqlStmtLine, connection_v if field.typ.has_flag(.option) { opt_fields << arrs.len } - arrs << unsafe { node.sub_structs[int(field.typ)] } + if node.sub_structs.len > 0 { + arrs << unsafe { node.sub_structs[int(field.typ)] } + } field_names << field.name } }