I prefer to set a test whether the variable exists. If your query fails, the table is empty, or in the worst case, nil.
So you can test it with an if statement like that :
if query and query[1] then
-- or
if (query or {}) [1] then
-- or
chat('sth '.. ((query or {{0}})[1] or {0})[1})
the latest is pro code, you don't need to understand it, but if you do, Nice
With those statements you prevent syserr messages
Sent by Tapatalk @ Galaxy Note 10.1