If a value is None and it is required, don't flag it as invalid.

git-svn-id: http://svn.robofab.com/branches/ufo3k@398 b5fa9d6c-a76f-4ffd-b3cb-f825fc41095c
This commit is contained in:
Tal Leming 2011-10-11 19:29:16 +00:00
parent dcd97ba1ea
commit 3721472a50

View File

@ -81,7 +81,9 @@ def genericDictValidator(value, prototype):
return False
# incorrect types
for key, v in value.items():
prototypeType = prototype[key][0]
prototypeType, required = prototype[key]
if v is None and not required:
continue
if not isinstance(v, prototypeType):
return False
return True