Skip to content

Commit

Permalink
make GetUnitFrames more resilient to bad input
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbuds committed Jan 4, 2021
1 parent fe34d2d commit 3182bb3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions LibGetFrame-1.0.lua
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,14 @@ end

local function GetUnitFrames(target, ignoredFrames)
if not UnitExists(target) then
if type(target) == "string" and target:find("Player") then
if type(target) ~= "string" then return end
if target:find("Player") then
target = select(6, GetPlayerInfoByGUID(target))
else
target = target:gsub(" .*", "")
if not UnitExists(target) then
return
end
end
if not UnitExists(target) then
return
end
end

Expand Down

0 comments on commit 3182bb3

Please sign in to comment.