Persistence: Fix Lua log file table dump

This commit is contained in:
Lars Mueller 2021-05-12 20:45:15 +02:00
parent 8dc3054dd0
commit 29ed334369

@ -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