Skip to content

Commit 22cad3a

Browse files
authored
toStruct: set a field to null if the field is nullable and isn't getting set (#207)
1 parent 499d3b1 commit 22cad3a

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎src/lib.zig‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4990,6 +4990,8 @@ pub const Lua = opaque {
49904990
@field(result, field.name) = default;
49914991
} else if (field_type_info != .optional) {
49924992
return error.LuaTableMissingValue;
4993+
} else {
4994+
@field(result, field.name) = null;
49934995
}
49944996
} else {
49954997
const stack_size_before_call = lua.getTop();

0 commit comments

Comments
 (0)