fix(lua): return v[field] instead of nil when v[field] is false

Problem:
When `v[field]` returns `false`, the ternary operator will make it return `nil`.

Solution:
Return `v[field]` once `v` is not `nil`.
This commit is contained in:
Yi Ming
2026-05-06 20:32:56 +08:00
parent 83f9944911
commit b8af8d7672

View File

@@ -392,7 +392,7 @@ local function make_key_fn(key)
local field = key
---@param v any
key = function(v)
return v and v[field] or nil
return v and v[field]
end
end