ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Lua/XML Help (https://www.esoui.com/forums/forumdisplay.php?f=175)
-   -   Cant find source of "index a nil value" (https://www.esoui.com/forums/showthread.php?t=7828)

deljason 06/01/18 11:41 AM

Cant find source of "index a nil value"
 
I'm trying to fix an addon that broke with Summerset with "index a nil value" errors. The problem I have is I cant figure out where the actual error is in the code.

I get two of them, one is reported on line 221 of GamePadBuddy.lua in function "Main Chunk" and the other is on line 4 of AddonMenu.lua in function " Main Chunk".


In the GamePadBuddy file line 221 has a } bracket which is at the end of a table.

Code:

GamePadBuddy.defaultAcctSettings = {
--account
        accountWideSetting = true,
--general
        invtooltip = true,
        traitmarkers = true,
        ornateintricate = true,
        hideresearchables = true,
        fastteleport = true,
        qhtcc = true,
--tooltip
        mm = true,
        ttc = true,
  att = true,
        setinfo = true,
        recipes = true,
}

In AddonMenu.lua the error points to this line:

Code:

GamePadBuddy.AddonMenu = {}
The problem is, its not telling me which function is 'indexing a nil value'. Any ideas how I can figure out what is going wrong? I'm guessing it thinks "GamePadBuddy" is nil or something. Not really sure.

Baertram 06/01/18 01:50 PM

Pleas epost the whole lua error message you get here including the call stack! Maybe this helps.
Do you get the error message on the GamepadBuddy addon which one can download here at esoui (same version, no changes?) or di you change something already?
Did you test it without any other addons?
Did you update the libraries used in this addon (if there are any and if they were updated in the past)?

deljason 06/01/18 02:00 PM

Quote:

Originally Posted by Baertram (Post 34893)
Pleas epost the whole lua error message you get here including the call stack! Maybe this helps.
Do you get the error message on the GamepadBuddy addon which one can download here at esoui (same version, no changes?) or di you change something already?
Did you test it without any other addons?
Did you update the libraries used in this addon (if there are any and if they were updated in the past)?

It is on the unmodified version of GamePadBuddy http://www.esoui.com/downloads/info1...ePadBuddy.html


It happens even if this is the only addon enabled.

I grabbed a fresh libaddonmenu 2.0 and libstub but that did not help.

I figured out that the addon partially works despite the errors. However, the 'addon' menu is not there, presumably due to the error in the AddonMenu.lua file and integration with TTC isn't working.

Here is what appears in the log file (and error box ingame):

2018-06-01T13:58:55.916-07:00 |cff0000Lua Error: user:/AddOns/GamePadBuddy/GamePadBuddy.lua:221: attempt to index a nil value
stack traceback:
user:/AddOns/GamePadBuddy/GamePadBuddy.lua:221: in function '(main chunk)'|r
2018-06-01T13:58:55.917-07:00 |cff0000Lua Error: user:/AddOns/GamePadBuddy/AddonMenu.lua:4: attempt to index a nil value
stack traceback:
user:/AddOns/GamePadBuddy/AddonMenu.lua:4: in function '(main chunk)'|r

018-06-01T14:13:12.567-07:00 |cff0000Lua Error: user:/AddOns/GamePadBuddy/GamePadBuddy.lua:221: attempt to index a nil value
stack traceback:
user:/AddOns/GamePadBuddy/GamePadBuddy.lua:221: in function '(main chunk)'|r
2018-06-01T14:13:12.567-07:00 |cff0000Lua Error: user:/AddOns/GamePadBuddy/AddonMenu.lua:4: attempt to index a nil value
stack traceback:
user:/AddOns/GamePadBuddy/AddonMenu.lua:4: in function '(main chunk)'|r

deljason 06/01/18 02:30 PM

Not sure what changed, but I just re-copied a fresh set of files over and now its working. I had installed via Minion originally but this time I just manually copied the files. I don't see anything different in the list of files though.

I've even re enabled all the other addons I have and no error anymore. No clue why the error was there in the first place unless Minion somehow installed an incorrect version of a file, or was missing one.

Baertram 06/01/18 03:08 PM

This might happen. Just tested it myself and it works fine for me -> no error messages, did not test the addon itsself! (using fresh libAddonmenu and libStub)

SDPhantom 06/01/18 06:20 PM

Just as an answer, those two errors were expecting the variable GamePadBuddy to be a table and it was nil. The indexing operation merely means it was trying to write an entry into a table that didn't exist.

ArtOfShred 06/01/18 06:40 PM

Quote:

Originally Posted by deljason (Post 34896)
Not sure what changed, but I just re-copied a fresh set of files over and now its working. I had installed via Minion originally but this time I just manually copied the files. I don't see anything different in the list of files though.

I've even re enabled all the other addons I have and no error anymore. No clue why the error was there in the first place unless Minion somehow installed an incorrect version of a file, or was missing one.

Seems very likely. I have a lot of users of LUIE that experience wierd issues with Minion installs. Or maybe not even that in all cases - but somehow the directory structure either gets compromised, files are missing, or the addon is nested. This may be from manual user error in many cases but due to the number of comments I've received related to it - I doubt that's accounting for all of it.


All times are GMT -6. The time now is 03:32 PM.

vBulletin © 2020, Jelsoft Enterprises Ltd
© 2014 - 2019 MMOUI