Software /
code /
prosody
Diff
util/dataforms.lua @ 1945:adfd7f3720f5
util.dataforms: Small fix to allow generating forms without specifying any input data
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sat, 10 Oct 2009 03:09:15 +0100 |
parent | 1944:754eebd31538 |
child | 1958:e2b0026143c4 |
line wrap: on
line diff
--- a/util/dataforms.lua Sat Oct 10 02:21:25 2009 +0100 +++ b/util/dataforms.lua Sat Oct 10 03:09:15 2009 +0100 @@ -37,7 +37,7 @@ -- 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