diff options
author | Matthew Wild <mwild1@gmail.com> | 2009-10-10 03:09:15 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2009-10-10 03:09:15 +0100 |
commit | f266d2acc7ec9f8c0c63eaf3e6da207b0aa85cdf (patch) | |
tree | dde81bd51450b1ab5b6a42b19726ba75cf5fe87c | |
parent | aba0949354eefcb6b1279aed5f57a9984b8b9b66 (diff) | |
download | prosody-f266d2acc7ec9f8c0c63eaf3e6da207b0aa85cdf.tar.gz prosody-f266d2acc7ec9f8c0c63eaf3e6da207b0aa85cdf.zip |
util.dataforms: Small fix to allow generating forms without specifying any input data
-rw-r--r-- | util/dataforms.lua | 2 |
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 |