View Single Post
11-13-22, 05:42 PM   #1
AkromaStrategy
A Defias Bandit
Join Date: Nov 2022
Posts: 2
Help with Lua Error

Hello,

There is this super cool addon called Glass that did a minimalistic chat ui.

side note: while typing this i noticed someone else has already put something up that i might use instead, but i'll ask my question anyways for fun.

while trying to fix it for dragonflight I got this error

Message: Interface/AddOns/Glass/Glass/Components/ChatTab.lua:48: attempt to index field '?' (a nil value)
Time: Sun Nov 13 15:21:02 2022
Count: 1
Stack: Interface/AddOns/Glass/Glass/Components/ChatTab.lua:48: attempt to index field '?' (a nil value)
[string "@Interface/AddOns/Glass/Glass/Components/ChatTab.lua"]:48: in function `Init'
[string "@Interface/AddOns/Glass/Glass/Components/ChatTab.lua"]:176: in function <Interface/AddOns/Glass/Glass/Components/ChatTab.lua:172>
[string "@Interface/AddOns/Glass/Glass/Modules/UIManager.lua"]:59: in function <Interface/AddOns/Glass/Glass/Modules/UIManager.lua:36>
[string "=[C]"]: ?
[string "@Interface/AddOns/Glass/libs/AceAddon-3.0/AceAddon-3.0.lua"]:70: in function <...face/AddOns/Glass/libs/AceAddon-3.0/AceAddon-3.0.lua:65>
[string "@Interface/AddOns/Glass/libs/AceAddon-3.0/AceAddon-3.0.lua"]:527: in function `EnableAddon'
[string "@Interface/AddOns/Glass/libs/AceAddon-3.0/AceAddon-3.0.lua"]:540: in function `EnableAddon'
[string "@Interface/AddOns/Glass/libs/AceAddon-3.0/AceAddon-3.0.lua"]:630: in function <...face/AddOns/Glass/libs/AceAddon-3.0/AceAddon-3.0.lua:615>

Locals: <none>
I write java/scala at my day job so i'm not an expert at lua, but i was wondering if anyone could tell why this is getting a null pointer exception? Line 48 that it references is the line below of _G[self:GetName()..texName..'Left']:SetTexture()

local tabTexs = {
'',
'Selected',
'Highlight'
}

local dropDown = _G[self.chatFrame:GetName().."TabDropDown"]

for _, texName in ipairs(tabTexs) do
_G[self:GetName()..texName..'Left']:SetTexture()
_G[self:GetName()..texName..'Middle']:SetTexture()
_G[self:GetName()..texName..'Right']:SetTexture()
end
  Reply With Quote