This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
billysback's profile picture

table expected, got nil

Started by billysback, 24 November 2012 - 05:30 AM
billysback #1
Posted 24 November 2012 - 06:30 AM
EDIT: actually, nvm I found the problem.

getting nil from this code should be impossible… errors tell me it isn't

95: local users = self.users
96: if users == nil then users = {} end
97: users[name] = { id, {} }
98: self.users = users

error:

APINAME:97: table index expected, got nil

the table "users" in self should be defined, but it was bugging so I tried to catch the bugs… still doesn't work.
Kingdaro #2
Posted 24 November 2012 - 06:36 AM
It says table index expected. Maybe "name" doesn't exist?
billysback #3
Posted 24 November 2012 - 06:42 AM
name does exist, it was me forgetting to add a return to a function ;)/>/>