Skip to content

Commit 073aa8b

Browse files
committed
check nil
1 parent e67c6b2 commit 073aa8b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

script/plugins/ffi/c-parser/ctypes.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,10 @@ end
149149
local function add_to_fields(lst, field_src, fields)
150150
if type(field_src) == "table" and not field_src.ids then
151151
assert(field_src.type.type == "union")
152-
local subfields = get_fields(lst, field_src.type.fields)
152+
local subfields, err = get_fields(lst, field_src.type.fields)
153+
if not subfields then
154+
return nil, err
155+
end
153156
for _, subfield in ipairs(subfields) do
154157
table.insert(fields, subfield)
155158
end

0 commit comments

Comments
 (0)