Originally Posted by SDPhantom
I've had this error pop up through my own addon code for a while and it's completely in Blizzard's UI. If Blizzard_InspectUI loads for any reason, even manually inspecting a player through Blizzard's own menus, the Inspection UI registers for the INSPECT_READY event. If this event were to fire at all while the inspection window is closed, it runs into an error with the stored UnitID being nil.
The following is a modified version of patch code I wrote a long time ago to fix this problem.
lua Code:
local function patch() local oldfunc1=InspectPaperDollFrame_SetLevel; InspectPaperDollFrame_SetLevel=function(...) if InspectFrame.unit and UnitExists(InspectFrame.unit) then return oldfunc1(...); end end; local oldfunc2=InspectGuildFrame_Update; InspectGuildFrame_Update=function(...) if InspectFrame.unit and UnitExists(InspectFrame.unit) then return oldfunc2(...); end end; end if IsAddOnLoaded("Blizzard_InspectUI") then patch(); else local eframe=CreateFrame("Frame"); eframe:RegisterEvent("ADDON_LOADED"); eframe:SetScript("OnEvent",function(self,event,arg) if event=="ADDON_LOADED" and arg=="Blizzard_InspectUI" then self:UnregisterEvent(event); patch(); end end); end
|
and where would i paste this?