aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rw-r--r--util/dataforms.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/util/dataforms.lua b/util/dataforms.lua
index e48f6879..64f73c11 100644
--- a/util/dataforms.lua
+++ b/util/dataforms.lua
@@ -42,9 +42,14 @@ function form_t.form(layout, data, formtype)
form:text_tag("desc", field.desc);
end
- local value = (data and data[field.name]) or field.value;
+ local value;
+ if data and data[field.name] ~= nil then
+ value = data[field.name];
+ else
+ value = field.value;
+ end
- if value then
+ if value ~= nil then
-- Add value, depending on type
if field_type == "hidden" then
if type(value) == "table" then