Changeset

4435:ea69296afaef

util.dataforms: Fix verfication for booleans
author Florian Zeitz <florob@babelmonkeys.de>
date Sat, 03 Dec 2011 17:10:48 +0100
parents 4434:51a7c85751b9
children 4436:aa79b3767f98
files util/dataforms.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/util/dataforms.lua	Fri Dec 02 19:24:54 2011 +0100
+++ b/util/dataforms.lua	Sat Dec 03 17:10:48 2011 +0100
@@ -252,7 +252,7 @@
 field_verifiers["boolean"] =
 	function (data, field_tag, required)
 		data = field_readers["text-single"](field_tag);
-		if #data == 0 and required then
+		if ((not data) or (#data == 0)) and required then
 			return "Required value missing";
 		end
 		if data ~= "1" and data ~= "true" and data ~= "0" and data ~= "false" then