fixed broken INIs rather than hiding the brokenness

This commit is contained in:
Chris Forbes
2010-02-11 15:39:17 +13:00
parent fb23c0ed0c
commit 5b3dde1c5f
8 changed files with 4 additions and 62 deletions

View File

@@ -11,8 +11,9 @@ namespace OpenRa.FileFormats
foreach (var x in ini)
{
var field = self.GetType().GetField(x.Key.Trim());
if( field != null )
field.SetValue(self, GetValue(field.FieldType, x.Value.Trim()));
if (field == null)
throw new NotImplementedException("Missing field `{0}` on `{1}`".F(x.Key.Trim(), self.GetType().Name));
field.SetValue(self, GetValue(field.FieldType, x.Value.Trim()));
}
}