team.GetColor, bad argument #1 to 'pairs' (table expected, got userdata)

While attempting to get a team’s color using this:


linecolor = team.GetColor ( 1 )

I get this:


[ERROR] lua/includes/extensions/table.lua:29: bad argument #1 to 'pairs' (table expected, got userdata)

I don’t really understand why it gives me this error, when I can get a team’s name and other team things the same way without any errors.
For example, on the line before the one giving the error, this works just fine:


print( team.GetName( t ) )

EDIT:
Problem was bad values in team.SetUp() for color.