diff options
author | emkael <emkael@tlen.pl> | 2017-07-30 14:23:19 +0200 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2017-07-30 14:23:19 +0200 |
commit | 915e4fd49087c38a2559f08512db5d2e2cfb37bc (patch) | |
tree | 96b5a089ec4c089e5601b784ab2fca06de91c438 | |
parent | e8cab0a6f50acda60917d0cf1b23497ffc4e314e (diff) |
Checking for zero-length names in RRB provider
-rw-r--r-- | Aktywator/RRBTournament.cs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Aktywator/RRBTournament.cs b/Aktywator/RRBTournament.cs index d35e8f3..20a3c21 100644 --- a/Aktywator/RRBTournament.cs +++ b/Aktywator/RRBTournament.cs @@ -61,10 +61,17 @@ namespace Aktywator names.Add(pairNo, new List<string>()); foreach (XmlNode player in pair.SelectNodes("gracz/nazwisko")) { - string[] name = player.InnerText.Trim().Split(' '); - if (name.Length > 0) + if ("pauza".Equals(player.InnerText.Trim())) { - name[0] = name[0][0].ToString(); + names[pairNo].Add(""); + } + else + { + string[] name = player.InnerText.Trim().Split(' '); + if (name.Length > 0) + { + name[0] = (name[0].Length > 0) ? name[0][0].ToString() : ""; + } names[pairNo].Add(String.Join(" ", name)); } } |