util.dataforms: Small fix to allow generating forms without specifying any input...
authorMatthew Wild <mwild1@gmail.com>
Sat, 10 Oct 2009 02:09:15 +0000 (03:09 +0100)
committerMatthew Wild <mwild1@gmail.com>
Sat, 10 Oct 2009 02:09:15 +0000 (03:09 +0100)
util/dataforms.lua

index 1619ddc58f391091fd3c1faccc81ccfc40c27512..b9fd23f2e2a0781104b969cfeb609815764f268b 100644 (file)
@@ -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