diff options
Diffstat (limited to 'tdd')
-rw-r--r-- | tdd/tdd-bootstrap.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tdd/tdd-bootstrap.php b/tdd/tdd-bootstrap.php index b6de1c0..4c0a484 100644 --- a/tdd/tdd-bootstrap.php +++ b/tdd/tdd-bootstrap.php @@ -54,13 +54,16 @@ class Protocol { } function areBoardsPlayed($boards) { + if (!$boards) { + return FALSE; + } foreach ($boards as $board) { $dom = str_get_html($board); $isFirstRow = count($dom->find('td/a')); $contract = trim(str_replace(' ', '', $dom->find('td[class="bdc"]', 0)->innertext)); $score = trim(str_replace(' ', '', $dom->find('td', 5 + $isFirstRow)->innertext)); // note that the contract field for arbitral scores starts with 'A' (e.g. 'ARB' or 'AAA') - if ($score == '' && $contract[0] != 'A') { + if ($score == '' && (!strlen($contract) || $contract[0] != 'A')) { return FALSE; } } |