aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2012-01-22 23:59:19 +0000
committerMatthew Wild <mwild1@gmail.com>2012-01-22 23:59:19 +0000
commitf7528a035b19a5a9278ec3b4bbfab86ba8e600ed (patch)
tree949bf8ecd834956f10ffd0e9203692cc0ab756a4 /util
parent13b36f8ded00794f3142887c41ac8b31efb01e4b (diff)
downloadprosody-f7528a035b19a5a9278ec3b4bbfab86ba8e600ed.tar.gz
prosody-f7528a035b19a5a9278ec3b4bbfab86ba8e600ed.zip
util.set: Accept nil to add_list()
Diffstat (limited to 'util')
-rw-r--r--util/set.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/util/set.lua b/util/set.lua
index e4cc2dff..050446ec 100644
--- a/util/set.lua
+++ b/util/set.lua
@@ -82,8 +82,10 @@ function new(list)
end
function set:add_list(list)
- for _, item in ipairs(list) do
- items[item] = true;
+ if list then
+ for _, item in ipairs(list) do
+ items[item] = true;
+ end
end
end