fix a null reference exception

This commit is contained in:
Matthias Mailänder
2015-07-04 09:43:31 +02:00
parent af6f1ef675
commit 10d76da61b

View File

@@ -438,11 +438,15 @@ namespace OpenRA
static object ParseYesNo(string p, Type fieldType, string field)
{
if (string.IsNullOrEmpty(p))
return InvalidValueAction(p, fieldType, field);
p = p.ToLowerInvariant();
if (p == "yes") return true;
if (p == "true") return true;
if (p == "no") return false;
if (p == "false") return false;
return InvalidValueAction(p, fieldType, field);
}