View Single Post
04-10-10, 05:52 AM   #83
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,928
I've actually been starting to do tests on the existence of self in my functions just in case that has been wiped. Every value is being tested before being used just in case.

eg
function CreateMyFrame(...)
local f = CreateFrame(...)
f.AFunction = function(self)
if not self then return end
...
end
return f
end

local myframe = CreateMyFrame(...)
if ( myframe ) then myframe:AFunction(...) end

lots of testing but its the only way I know of getting it to gracefully bow out instead of erroring left right and center.

I'm starting to wonder if the new introduction of the local addonTable, addonData = ... feature to create a local but yet addonwide table has started a wave of altering the scope of variables.

And yeah its annoying that it seems to be doing that.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818