Skip to content

Commit

Permalink
fix(Range): Fix potential nil error
Browse files Browse the repository at this point in the history
  • Loading branch information
Cilraaz committed Nov 24, 2023
1 parent 3fa2dc9 commit 94eb8ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion HeroLib/Class/Unit/Range.lua
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ local function FindRange(ThisUnit, Max)
if not RangeIndex then return nil end

for i = #RangeIndex - (Max and 1 or 0), 1, -1 do
if not ThisUnit:IsInRange(RangeIndex[i]) then
if RangeIndex[i] and not ThisUnit:IsInRange(RangeIndex[i]) then
return Max and RangeIndex[i + 1] or RangeIndex[i]
end
end
Expand Down

0 comments on commit 94eb8ca

Please sign in to comment.