Thread Tools Display Modes
Prev Previous Post   Next Post Next
04-21-15, 07:51 PM   #1
Yafis
A Fallenroot Satyr
 
Yafis's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2014
Posts: 29
GetName Error

Hi! How to do a background check so as not to give an error when using :GetName() in the Game Shop or Send Twitter
My Lua code:
Lua Code:
  1. local SFN = CreateFrame("Frame")
  2. SFN:SetScript("OnUpdate", function()
  3.     local f = GetMouseFocus()
  4.     if f then
  5.         local n = f:GetName() or tostring(f)
  6.         if n then
  7.             FramerateLabel:SetText(n.." - FPS: ")
  8.         end
  9.     end
  10. end)

Error:
Code:
Message: Interface\AddOns\WorldTools\Libs\lib_hook.lua:29: Attempt to access forbidden object from code tainted by an AddOn
Time: 04/22/15 04:48:51
Count: 182
Stack: [C]: in function `GetName'
Interface\AddOns\WorldTools\Libs\lib_hook.lua:29: in function <Interface\AddOns\WorldTools\Libs\lib_hook.lua:26>

Locals: (*temporary) = <unnamed> {
 SplashBanner = <unnamed> {
 }
 CurrentMarketPrice = <unnamed> {
 }
 NormalPrice = <unnamed> {
 }
 InvisibleMouseOverFrame = <unnamed> {
 }
 Strikethrough = <unnamed> {
 }
 GlowPulse = <unnamed> {
 }
 IconBorder = <unnamed> {
 }
 SplashBannerText = <unnamed> {
 }
 Icon = <unnamed> {
 }
 UpgradeArrow = <unnamed> {
 }
 Shadows = <unnamed> {
 }
 BuyButton = <unnamed> {
 }
 ProductName = <unnamed> {
 }
 Checkmark = <unnamed> {
 }
 Magnifier = <unnamed> {
 }
 Model = <unnamed> {
 }
 BannerFadeIn = <unnamed> {
 }
 0 = <userdata>
 Card = <unnamed> {
 }
 GlowSpin = <unnamed> {
 }
 Description = <unnamed> {
 }
 CurrentPrice = <unnamed> {
 }
 SalePrice = <unnamed> {
 }
}

Last edited by Yafis : 04-21-15 at 07:53 PM.
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » GetName Error


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off