Persistence: Fix Lua log file table dump

master
Lars Mueller 2021-05-12 20:45:15 +02:00
parent 8dc3054dd0
commit 29ed334369
1 changed files with 2 additions and 1 deletions

View File

@ -103,8 +103,9 @@ function lua_log_file:_dump(value, is_key)
for _, value in ipairs(value) do for _, value in ipairs(value) do
table.insert(entries, self:_dump(value)) table.insert(entries, self:_dump(value))
end end
local tablelen = #value
for key, value in pairs(value) do for key, value in pairs(value) do
if type(key) ~= "number" or key % 1 ~= 0 or key < 1 or key > #value then if type(key) ~= "number" or key % 1 ~= 0 or key < 1 or key > tablelen then
local dumped, short = self:_dump(key, true) local dumped, short = self:_dump(key, true)
table.insert(entries, (short and dumped or ("[" .. dumped .. "]")) .. "=" .. self:_dump(value)) table.insert(entries, (short and dumped or ("[" .. dumped .. "]")) .. "=" .. self:_dump(value))
end end