brittyazel / Neuron

A full-featured World of Warcraft action bar and interface replacement addon
https://www.curseforge.com/wow/addons/neuron
MIT License
31 stars 21 forks source link

Constant lua errors on some toons, appears to be Masque related #467

Closed Ketrel closed 2 years ago

Ketrel commented 2 years ago

Issue description:

Many lua errors with Masque enabled

How to reproduce:

E.g., Steps to reproduce the behavior...

  1. Toon with this profile: https://gist.github.com/Ketrel/3a2f562763fe540de7548079423b9ca4
  2. Neuron enabled + Masque enabled
  3. No config done on Masque side (nuked the savedvariable for it)

Technical info:

Additional context:

It looks like this code block in Button.lua line 386-389 is the issue

if self.__MSQ_NormalSkin then
    actionTexture = self.__MSQ_NormalSkin.Texture
    noactionTexture = self.__MSQ_NormalSkin.Texture.EmptyTexture
else   

Based on what I'm seeing, Texture may not be set even if __MSQ_NormalSkin is.

I stopped the errors on my end by changing the if statement to

if self.__MSQ_NormalSkin and self.__MSQ_NormalSkin.Texture then  

Lua error log:

290x Neuron/Objects/Button.lua:388: attempt to index field 'Texture' (a nil value)
[string "@Neuron/Objects/Button.lua"]:388: in function `UpdateNormalTexture'
[string "@Neuron/Objects/ActionButton.lua"]:865: in function `UpdateIcon'
[string "@Neuron/Objects/Button.lua"]:369: in function `UpdateAll'
[string "@Neuron/Objects/ActionButton.lua"]:726: in function `?'
[string "@Ace3/CallbackHandler-1.0-7/CallbackHandler-1.0.lua"]:114: in function <...Ons/Ace3/CallbackHandler-1.0/CallbackHandler-1.0.lua:114>
[string "=[C]"]: ?
[string "@Ace3/CallbackHandler-1.0-7/CallbackHandler-1.0.lua"]:24: in function <...Ons/Ace3/CallbackHandler-1.0/CallbackHandler-1.0.lua:20>
[string "@Ace3/CallbackHandler-1.0-7/CallbackHandler-1.0.lua"]:59: in function `Fire'
[string "@Ace3/AceEvent-3.0-4/AceEvent-3.0.lua"]:120: in function <Ace3/AceEvent-3.0/AceEvent-3.0.lua:119>
ylixir commented 2 years ago

i don't actually use masque, but i'll roll your fix into my next PR unless you want to open your own.

Good find!