diff --git a/api/api.lua b/api/api.lua index d731b9a3..49508a90 100644 --- a/api/api.lua +++ b/api/api.lua @@ -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")