diff --git a/data/core/common.lua b/data/core/common.lua index 1aa2b86e..6b4d9782 100644 --- a/data/core/common.lua +++ b/data/core/common.lua @@ -18,9 +18,16 @@ end function common.merge(a, b) + a = type(a) == "table" and a or {} local t = {} - for k, v in pairs(a) do t[k] = v end - if b then for k, v in pairs(b) do t[k] = v end end + for k, v in pairs(a) do + t[k] = v + end + if b and type(b) == "table" then + for k, v in pairs(b) do + t[k] = v + end + end return t end