Changeset

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
parents 1944:754eebd31538
children 1946:0eb3835ef9bf
files util/dataforms.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
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