diff options
author | Malcolm Reynolds <mareynolds@google.com> | 2016-01-29 14:21:48 +0300 |
---|---|---|
committer | Malcolm Reynolds <mareynolds@google.com> | 2016-01-29 14:21:48 +0300 |
commit | 1c5742fef67edf3ce20eb2e0cae9f1abee5e3ce4 (patch) | |
tree | 96a22e587ba6ad2800e00b61c39e61c871e45a2d | |
parent | 3e84c827f635ee516c17d5374360501626ced13d (diff) |
avoid string concatenation error when key type is not string or number
-rw-r--r-- | nesting.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/nesting.lua b/nesting.lua index a58066b..4440797 100644 --- a/nesting.lua +++ b/nesting.lua @@ -62,7 +62,8 @@ function nesting.copyNested(output, input) -- Extra elements in the output table cause an error. for key, child in pairs(output) do if not input[key] then - error('key ' .. key .. ' present in output but not in input') + error('key ' .. tostring(key) .. + ' present in output but not in input') end end end |