Skip to content

Commit

Permalink
fix nil error
Browse files Browse the repository at this point in the history
  • Loading branch information
Tuller committed Nov 22, 2024
1 parent a3f3c8d commit 8e73c1f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion OmniCC/core/timer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,17 @@ Timer.__index = Timer

---@param cooldown OmniCCCooldown
function Timer:GetOrCreate(cooldown)
local endTime = (cooldown._occ_start + cooldown._occ_duration) * SECOND
local start = cooldown._occ_start or 0
if start <= 0 then
return
end

local duration = cooldown._occ_duration or 0
if duration <= 0 then
return
end

local endTime = (start + duration) * SECOND
local kind = cooldown._occ_kind
local settings = cooldown._occ_settings
local key = strjoin('/', kind, tostring(endTime), tostring(settings or 'NONE'))
Expand Down

0 comments on commit 8e73c1f

Please sign in to comment.