Skip to content

Commit

Permalink
fix: checking if function exists instead of calling it
Browse files Browse the repository at this point in the history
  • Loading branch information
Manason authored Dec 29, 2024
1 parent 2129eaf commit f5e0762
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ local function releaseState(name, force)
if not states[name] then return false end
if states[name] <= 1 or force then
states[name] = nil
if config.states[name]?.onRelease() then
if config.states[name]?.onRelease then
config.states[name].onRelease()
end
return true
Expand All @@ -38,4 +38,4 @@ local function releaseState(name, force)
end

exports('SetState', setState)
exports('ReleaseState', releaseState)
exports('ReleaseState', releaseState)

0 comments on commit f5e0762

Please sign in to comment.