move the null check to avoid a crash
This commit is contained in:
@@ -334,13 +334,13 @@ namespace OpenRA
|
|||||||
|
|
||||||
var clean = SanitizedName(dirty);
|
var clean = SanitizedName(dirty);
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(clean) || forbiddenNames.Contains(clean) || botNames.Contains(clean))
|
||||||
|
clean = new PlayerSettings().Name;
|
||||||
|
|
||||||
// avoid UI glitches
|
// avoid UI glitches
|
||||||
if (clean.Length > 16)
|
if (clean.Length > 16)
|
||||||
clean = clean.Substring(0, 16);
|
clean = clean.Substring(0, 16);
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(clean) || forbiddenNames.Contains(clean) || botNames.Contains(clean))
|
|
||||||
clean = new PlayerSettings().Name;
|
|
||||||
|
|
||||||
return clean;
|
return clean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user