nil is not cast away when checking with if

---@class Entity
---@field direction integer
local ent = {}
---@class Event
---@field start? integer
local event = {}
---@param event Event
local function f(event)
if event.start then
ent.direction = event.start
end
end