Skip to content
Permalink
Browse files

Fix crash on passing false as value in table to table.copy(t)

Fixes #2293.
  • Loading branch information...
est31 authored and Zeno- committed Feb 12, 2015
1 parent d44cb54 commit 7c5accf60501e0ff7fd8f44af963b71da9ac8045
Showing with 2 additions and 3 deletions.
  1. +2 −3 builtin/common/misc_helpers.lua
@@ -545,12 +545,11 @@ function table.copy(t, seen)
seen = seen or {}
seen[t] = n
for k, v in pairs(t) do
n[type(k) ~= "table" and k or seen[k] or table.copy(k, seen)] =
type(v) ~= "table" and v or seen[v] or table.copy(v, seen)
n[(type(k) == "table" and (seen[k] or table.copy(k, seen))) or k] =
(type(v) == "table" and (seen[v] or table.copy(v, seen))) or v
end
return n
end

--------------------------------------------------------------------------------
-- mainmenu only functions
--------------------------------------------------------------------------------

0 comments on commit 7c5accf

Please sign in to comment.
You can’t perform that action at this time.