diff options
Diffstat (limited to 'Aktywator')
-rw-r--r-- | Aktywator/MainForm.cs | 10 | ||||
-rw-r--r-- | Aktywator/PBN.cs | 4 |
2 files changed, 11 insertions, 3 deletions
diff --git a/Aktywator/MainForm.cs b/Aktywator/MainForm.cs index 6144a28..09e191d 100644 --- a/Aktywator/MainForm.cs +++ b/Aktywator/MainForm.cs @@ -536,15 +536,19 @@ namespace Aktywator confirmMsg.Append("\nNagłówek pliku: " + pbn.title); } confirmMsg.Append("\nPierwszy rozkład: "); - for (int i = 0; i < pbn.handRecords[bws.lowBoard()].north.Length; i++) + int lowBoard = bws.lowBoard(); + while (lowBoard < pbn.handRecords.Length && pbn.handRecords[lowBoard] == null) { + lowBoard++; + } + for (int i = 0; i < pbn.handRecords[lowBoard].north.Length; i++) { - if ("".Equals(pbn.handRecords[bws.lowBoard()].north[i])) + if ("".Equals(pbn.handRecords[lowBoard].north[i])) { confirmMsg.Append("renons, "); } else { - confirmMsg.Append(pbn.handRecords[bws.lowBoard()].north[i]); + confirmMsg.Append(pbn.handRecords[lowBoard].north[i]); break; } } diff --git a/Aktywator/PBN.cs b/Aktywator/PBN.cs index e312d63..2e36aef 100644 --- a/Aktywator/PBN.cs +++ b/Aktywator/PBN.cs @@ -43,6 +43,10 @@ namespace Aktywator this._count++; } } + if (this._count == 0) + { + throw new Exception("PBN nie zawiera rozdań z zadanego przedziału"); + } if (pbn.Boards.Count > 0 && pbn.Boards[0].HasField("Event")) { this._title = pbn.Boards[0].GetField("Event"); |