View Single Post
08-28-16, 07:12 AM   #23
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Game92 View Post
When i actually remove the check it give errors for some reason

Lua Code:
  1. ...nterface\AddOns\AftermathhUI\Modules\Auras\Auras.lua:180: attempt to index local 'ABuffFrame' (a nil value)
1. When you post an error message, please also post the entire file where the error is originating. Without knowing what line 180 is, that error isn't very helpful.

2. As a general tip, it can be helpful to add some print statements to let you see when things are happening and what data the API is giving you. For example:

Code:
hooksecurefunc("AuraButton_Update", function(self, index, filter)
    local ABuffFrame = _G[self..index]
    print("AuraButton_Update", self, index, filter, ABuffFrame)
On second look, it looks like AuraButton_Update can actually be called for buttons that don't exist, but it would be better (easier to read at a glance) to do the check like this:

Code:
hooksecurefunc("AuraButton_Update", function(self, index, filter)
    local ABuffFrame = _G[self..index]
    if not ABuffFrame then return end
If that's not what line 180 is, please post the rest of the code.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote