Skip to content

Commit

Permalink
add nil check
Browse files Browse the repository at this point in the history
fixes 38
  • Loading branch information
Tuller committed Sep 22, 2024
1 parent 88d779d commit 1485360
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# tullaRange release notes

## 11.0.5

* Fix an error caused by the retrieval of a nil value when checking the spell costs of a macro.

## 11.0.4

* Fixed an issue causing range checking to incorrectly revert actions to displaying as usable,
Expand Down
10 changes: 6 additions & 4 deletions tullaRange/actionState.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ local function isUsuableAction(slot)
-- only run the check for spell macros
if spellID then
local costs = (GetSpellPowerCost or C_Spell.GetSpellPowerCost)(spellID)
for i = 1, #costs do
local cost = costs[i]
if costs then
for i = 1, #costs do
local cost = costs[i]

if UnitPower("player", cost.type) < cost.minCost then
return false, false
if UnitPower("player", cost.type) < cost.minCost then
return false, false
end
end
end
end
Expand Down

0 comments on commit 1485360

Please sign in to comment.