I need help debugging this error:
main.lua:116: attempt to index field ‘?’ (a nil value)
stack traceback:
main.lua: 116:in function <main.lua:99>
?: in function <?:218>
Line 116 is:
myLine:setStrokeColor(colors[myLine.color][1], colors[myLine.color][2], colors[myLine.color][3])
The colors table looks like:
local colors = {{0.31, 0.18, 0.31}, {0.29, 0, 0.51}, etc… } – table of table of RGB values
I don’t get this error all the time. It seems to happen after I let the program run for a few minutes. When I come back to it and interact with it, I often get this error.
Questions:
1.) Is the error saying that colors[myLine.color] is nil?
2.) what does <?:218> mean? It looks like a line number, but I don’t have that many lines in my program.