I am getting this error with table.sort() for sorting values lowest to highest.
The problem is is that it only happens sometimes so I cannot tell what is happening.
Log when it worked . (log shows the values):
Logs when it failed:
Sorting function (the value is in [1] of the score):
table.sort(scores, function(i, j)
if i[1] and j[1] then
if i[1] == j[1] then
return true
else
return i[1] >= j[1]
end
elseif i[1] == nil and j[1] == nil then
return false
elseif i[1] == nil then
return false
elseif j[1] == nil then
return true
else
return false
end
end)
Help would be gratefully appreciated .