Thread Tools Display Modes
06-17-17, 09:47 AM   #1
briskman3000
A Flamescale Wyrmkin
 
briskman3000's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 108
itemLink addon conflict help

Hey all,

So every so often, someone reports an issue with my addon throwing errors and every time it is the same issue and I have no idea why the error is being generated in the first place. It never happens when the addon is run standalone, it always has one or more addons listed in the error reports.

The most recent report is:

Code:
Message: ConvertRatings\ConvertRatings-1.10.5a.lua:147: Usage: GetItemInfo(itemID|"name"|"itemlink")
Stack: [C] in function 'GetItemInfo'
ConvertRatings\ConvertRatings-1.10.5a.lua:147: in function <ConvertRatings\ConvertRatings.lua:116>
[C] ?
[C] ?
[C] ?
...dOns\HiddenArtifactTracker\HiddenArtifactTracker.lua:133: in function <...dOns\HiddenArtifactTracker\HiddenArtifactTracker.lua:130>
[C] ?
[C] ?
[C] ?
...rface\TradeSkillMaster\Private\TooltipLib.lua:85: in function <...rface\TradeSkillMaster\Private\TooltipLib.lua:82>
[C] ?
[C] ?
[C] ?
[C] in function 'SetToyByItemID'
AutoBar\AutoBarClassBasicButton.lua:69: in function 'TooltipShow'
AutoBar\AutoBarClassPopupButton.lua:62: in function <AutoBar\AutoBarClassPopupButton.lua:55>
[C] ?
FrameXML\SecureHandlers.lua:264: in function <FrameXML\SecureHandlers.lua:261>
[C] ?
FrameXML\SecureHandlers.lua:320: in function <FrameXML\SecureHandlers.lua:304>
(tail call): ?
Time: 2017/06/16 12:58:39 Count: 2
Locals:
(*temporary) = nil

The line in question is:

Lua Code:
  1. local irare = select(3,GetItemInfo(itemLink))

For the life of me, I can't see why that line should be throwing an error ..... EVER. GetItemInfo() has 17 values returned when called, and I am only looking at the 3rd, which is the item rarity result, which every single item in the game has a value of.

All I can think is that for some reason, the other addons are preventing mine from capturing the itemLink of the moused over item, but how in the hell can that happen?

Any ideas?

full code link :https://github.com/mynian/ConvertRat...ertRatings.lua
__________________
My Addons: Convert Ratings Honor Track
  Reply With Quote
06-17-17, 10:20 AM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,877
Have you checked that itemLink contains valid information? The error is complaining about what is going in, not what's comming out.

Edit: I have several addons that check to see if tooltip:GetItem() actually returns a link that I would have to asume that sometimes it doesn't.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 06-17-17 at 01:04 PM.
  Reply With Quote
06-17-17, 04:56 PM   #3
brykrys
A Deviate Faerie Dragon
 
brykrys's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 13
Most likely comes from:
Code:
local name, itemLink = self:GetItem();
There is a known Blizzard bug where frame:GetItem will sometimes return nil - nothing to do with other AddOns.

You'll need to add a nil check for itemLink.
  Reply With Quote
06-18-17, 07:01 PM   #4
briskman3000
A Flamescale Wyrmkin
 
briskman3000's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 108
Originally Posted by brykrys View Post
Most likely comes from:
Code:
local name, itemLink = self:GetItem();
There is a known Blizzard bug where frame:GetItem will sometimes return nil - nothing to do with other AddOns.

You'll need to add a nil check for itemLink.
So if i just change:


Lua Code:
  1. local name, itemLink = self:GetItem();


to

Lua Code:
  1. local name, itemLink = self:GetItem();
  2.  
  3. if(itemLink == nil) then
  4.      return;
  5. end



it should prevent the error?
__________________
My Addons: Convert Ratings Honor Track
  Reply With Quote
06-18-17, 07:17 PM   #5
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,877
Indeed it should.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » itemLink addon conflict help


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