diff --git a/vlib/db/mysql/orm.c.v b/vlib/db/mysql/orm.c.v index fc01bdc56e..d7beedfb61 100644 --- a/vlib/db/mysql/orm.c.v +++ b/vlib/db/mysql/orm.c.v @@ -301,7 +301,11 @@ fn data_pointers_to_primitives(data_pointers []&u8, types []int, field_types []F } .type_datetime, .type_timestamp { string_time := unsafe { cstring_to_vstring(&char(data)) } - primitive = time.parse(string_time)! + if string_time == '' { + primitive = orm.Null{} + } else { + primitive = time.parse(string_time)! + } } else {} }