Skip to content

Commit

Permalink
nil check
Browse files Browse the repository at this point in the history
  • Loading branch information
eltreum0 committed May 9, 2023
1 parent 0618315 commit c20be0d
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions ElvUI_EltreumUI/Modules/DataTexts/Teleports.lua
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,10 @@ local function EltruismTeleportsOnEvent(self)
start,duration = GetSpellCooldown(tostring(E.db.ElvUI_EltreumUI.otherstuff.datatextteleport))
elseif E.db.ElvUI_EltreumUI.otherstuff.datatextteleporttype == "ITEM" then
local _, itemLink = GetItemInfo(E.db.ElvUI_EltreumUI.otherstuff.datatextteleport)
local itemid = itemLink:match("item:(%d+)")
start, duration = GetItemCooldown(itemid)
if itemLink then
local itemid = itemLink:match("item:(%d+)")
start, duration = GetItemCooldown(itemid)
end
end
if not start then return end
local cooldown = start + duration - GetTime()
Expand Down Expand Up @@ -461,8 +463,10 @@ local function EltruismTeleportsOnEnter()
start,duration = GetSpellCooldown(tostring(E.db.ElvUI_EltreumUI.otherstuff.datatextteleport))
elseif E.db.ElvUI_EltreumUI.otherstuff.datatextteleporttype == "ITEM" then
local _, itemLink = GetItemInfo(E.db.ElvUI_EltreumUI.otherstuff.datatextteleport)
local itemid = itemLink:match("item:(%d+)")
start, duration = GetItemCooldown(itemid)
if itemLink then
local itemid = itemLink:match("item:(%d+)")
start, duration = GetItemCooldown(itemid)
end
end
local cooldown = start + duration - GetTime()
if cooldown >= 2 then
Expand Down Expand Up @@ -546,8 +550,10 @@ local function EltruismTeleportsOnEnter()
startcd3, durationcd3 = GetSpellCooldown(tostring(E.db.ElvUI_EltreumUI.otherstuff.datatextteleport))
elseif E.db.ElvUI_EltreumUI.otherstuff.datatextteleporttype == "ITEM" then
local _, itemLink = GetItemInfo(E.db.ElvUI_EltreumUI.otherstuff.datatextteleport)
local itemid = itemLink:match("item:(%d+)")
startcd3, durationcd3 = GetItemCooldown(itemid)
if itemLink then
local itemid = itemLink:match("item:(%d+)")
startcd3, durationcd3 = GetItemCooldown(itemid)
end
end
if startcd3 and durationcd3 then
local cooldown4 = startcd3 + durationcd3 - GetTime()
Expand Down

0 comments on commit c20be0d

Please sign in to comment.