avoid a possible NRE

This commit is contained in:
Matthias Mailänder
2015-05-31 10:00:39 +02:00
parent a12e6a191b
commit 87a4e3da26

View File

@@ -55,11 +55,15 @@ namespace OpenRA
public static bool TryParse(string s, out WRange result) public static bool TryParse(string s, out WRange result)
{ {
result = WRange.Zero;
if (string.IsNullOrEmpty(s))
return false;
s = s.ToLowerInvariant(); s = s.ToLowerInvariant();
var components = s.Split('c'); var components = s.Split('c');
var cell = 0; var cell = 0;
var subcell = 0; var subcell = 0;
result = WRange.Zero;
switch (components.Length) switch (components.Length)
{ {