From ed6a6b61deff702309bc6537b57833fc46bf28e5 Mon Sep 17 00:00:00 2001 From: abcdefg30 Date: Thu, 22 Feb 2018 02:39:18 +0100 Subject: [PATCH] Throw a proper error when parsing an invalid int2 --- OpenRA.Game/FieldLoader.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OpenRA.Game/FieldLoader.cs b/OpenRA.Game/FieldLoader.cs index d26722144a..f09fd1f25d 100644 --- a/OpenRA.Game/FieldLoader.cs +++ b/OpenRA.Game/FieldLoader.cs @@ -548,6 +548,9 @@ namespace OpenRA if (value != null) { var parts = value.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); + if (parts.Length != 2) + return InvalidValueAction(value, fieldType, fieldName); + return new int2(Exts.ParseIntegerInvariant(parts[0]), Exts.ParseIntegerInvariant(parts[1])); }