diff options
author | Matthew Wild <mwild1@gmail.com> | 2012-01-22 23:59:19 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2012-01-22 23:59:19 +0000 |
commit | 72f03580e8be39593ed6a37c8630e572807f0864 (patch) | |
tree | 949bf8ecd834956f10ffd0e9203692cc0ab756a4 | |
parent | 70b25deb380e7ce510cb9ff1b0be2cd579d28692 (diff) | |
download | prosody-72f03580e8be39593ed6a37c8630e572807f0864.tar.gz prosody-72f03580e8be39593ed6a37c8630e572807f0864.zip |
util.set: Accept nil to add_list()
-rw-r--r-- | util/set.lua | 6 |
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 |