Thread Tools Display Modes
06/01/18, 11:41 AM   #1
deljason
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 9
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.
  Reply With Quote
06/01/18, 01:50 PM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
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)?
  Reply With Quote
06/01/18, 02:00 PM   #3
deljason
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 9
Originally Posted by Baertram View Post
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

Last edited by deljason : 06/01/18 at 02:16 PM.
  Reply With Quote
06/01/18, 02:30 PM   #4
deljason
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 9
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.

Last edited by deljason : 06/01/18 at 02:33 PM.
  Reply With Quote
06/01/18, 03:08 PM   #5
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
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)
  Reply With Quote
06/01/18, 06:20 PM   #6
SDPhantom
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 47
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.
  Reply With Quote
06/01/18, 06:40 PM   #7
ArtOfShred
 
ArtOfShred's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2016
Posts: 103
Originally Posted by deljason View Post
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.
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Cant find source of "index a nil value"

Thread Tools
Display Modes

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