From 87a4e3da264ddd212f2baa080df15cbcad31057c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sun, 31 May 2015 10:00:39 +0200 Subject: [PATCH] avoid a possible NRE --- OpenRA.Game/WRange.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/OpenRA.Game/WRange.cs b/OpenRA.Game/WRange.cs index a1eaaf5870..5004eec776 100644 --- a/OpenRA.Game/WRange.cs +++ b/OpenRA.Game/WRange.cs @@ -55,11 +55,15 @@ namespace OpenRA public static bool TryParse(string s, out WRange result) { + result = WRange.Zero; + + if (string.IsNullOrEmpty(s)) + return false; + s = s.ToLowerInvariant(); var components = s.Split('c'); var cell = 0; var subcell = 0; - result = WRange.Zero; switch (components.Length) {