aboutsummaryrefslogtreecommitdiffstats
path: root/util/dataforms.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2013-06-13 23:21:24 +0100
committerMatthew Wild <mwild1@gmail.com>2013-06-13 23:21:24 +0100
commitff224e953c0e4ca7ed515d59afb1f0d8db06298d (patch)
treec49c9c12f27f5512d0e35f6e290bbb9a43ebac59 /util/dataforms.lua
parenta3e3c7ecc7bccff307dd31a34c2400266782ef31 (diff)
parent17bc3cc408e2e08fbbafcd438e7e06cba586b7d4 (diff)
downloadprosody-ff224e953c0e4ca7ed515d59afb1f0d8db06298d.tar.gz
prosody-ff224e953c0e4ca7ed515d59afb1f0d8db06298d.zip
Merge 0.9->trunk
Diffstat (limited to 'util/dataforms.lua')
-rw-r--r--util/dataforms.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/util/dataforms.lua b/util/dataforms.lua
index 8634e337..52924841 100644
--- a/util/dataforms.lua
+++ b/util/dataforms.lua
@@ -187,7 +187,11 @@ field_readers["list-multi"] =
for value in field_tag:childtags("value") do
result[#result+1] = value:get_text();
end
- return result, (required and #result == 0 and "Required value missing" or nil);
+ if #result > 0 then
+ return result;
+ elseif required then
+ return nil, "Required value missing";
+ end
end
field_readers["text-multi"] =