diff --git a/components/lua/luastate.cpp b/components/lua/luastate.cpp index 4056fb59f9..b5b0832b98 100644 --- a/components/lua/luastate.cpp +++ b/components/lua/luastate.cpp @@ -104,7 +104,7 @@ namespace LuaUtil end local function nextForArray(array, index) index = (index or 0) + 1 - if index < #array then + if index <= #array then return index, array[index] end end