summaryrefslogtreecommitdiff
path: root/Aktywator
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2017-07-30 14:23:19 +0200
committeremkael <emkael@tlen.pl>2017-07-30 14:23:19 +0200
commit915e4fd49087c38a2559f08512db5d2e2cfb37bc (patch)
tree96b5a089ec4c089e5601b784ab2fca06de91c438 /Aktywator
parente8cab0a6f50acda60917d0cf1b23497ffc4e314e (diff)
Checking for zero-length names in RRB provider
Diffstat (limited to 'Aktywator')
-rw-r--r--Aktywator/RRBTournament.cs13
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));
}
}