mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-01 03:19:59 +00:00
Added GetNoNameObject debugging
This commit is contained in:
+10
@@ -1562,6 +1562,16 @@ end
|
||||
-- 'arg1' [string]
|
||||
-- return object
|
||||
function pfUI.api.GetNoNameObject(frame, objtype, layer, arg1, arg2)
|
||||
-- A nil/non-frame parent otherwise dies on frame:GetRegions()/:GetChildren()
|
||||
-- below, and the traceback stops here — useless, since all callers share this
|
||||
-- line. pfUI shadows Lua's `error` (dropping the level arg and not throwing),
|
||||
-- so fold the caller frame in via debugstack to name the offending skin, then
|
||||
-- bail so we don't fall through and crash on frame:GetRegions() anyway.
|
||||
if type(frame) ~= "table" or not frame.GetRegions then
|
||||
error("GetNoNameObject: invalid parent frame\n" .. debugstack(2, 3, 0))
|
||||
return
|
||||
end
|
||||
|
||||
local arg1 = arg1 and gsub(arg1, "([%+%-%*%(%)%?%[%]%^])", "%%%1")
|
||||
local arg2 = arg2 and gsub(arg2, "([%+%-%*%(%)%?%[%]%^])", "%%%1")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user