aboutsummaryrefslogtreecommitdiffstats
path: root/util/dataforms.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-10-10 03:09:15 +0100
committerMatthew Wild <mwild1@gmail.com>2009-10-10 03:09:15 +0100
commitf266d2acc7ec9f8c0c63eaf3e6da207b0aa85cdf (patch)
treedde81bd51450b1ab5b6a42b19726ba75cf5fe87c /util/dataforms.lua
parentaba0949354eefcb6b1279aed5f57a9984b8b9b66 (diff)
downloadprosody-f266d2acc7ec9f8c0c63eaf3e6da207b0aa85cdf.tar.gz
prosody-f266d2acc7ec9f8c0c63eaf3e6da207b0aa85cdf.zip
util.dataforms: Small fix to allow generating forms without specifying any input data
Diffstat (limited to 'util/dataforms.lua')
-rw-r--r--util/dataforms.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/dataforms.lua b/util/dataforms.lua
index 1619ddc5..b9fd23f2 100644
--- a/util/dataforms.lua
+++ b/util/dataforms.lua
@@ -37,7 +37,7 @@ function form_t.form(layout, data)
-- Add field tag
form:tag("field", { type = field_type, var = field.name, label = field.label });
- local value = data[field.name] or field.value;
+ local value = (data and data[field.name]) or field.value;
-- Add value, depending on type
if field_type == "hidden" then