From 10d76da61b07296bcc7e41e5e0758848607535c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sat, 4 Jul 2015 09:43:31 +0200 Subject: [PATCH] fix a null reference exception --- OpenRA.Game/FieldLoader.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/OpenRA.Game/FieldLoader.cs b/OpenRA.Game/FieldLoader.cs index a186a678e7..63b99f3988 100644 --- a/OpenRA.Game/FieldLoader.cs +++ b/OpenRA.Game/FieldLoader.cs @@ -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); }