diff options
author | emkael <emkael@tlen.pl> | 2019-08-09 13:38:24 +0200 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2019-08-09 13:38:24 +0200 |
commit | 04807d2ce79370bea9ca8dddfaafdc46a0fed40b (patch) | |
tree | 85c39366fe1e0865093c377b79afa10e96e4a7f8 /dealconvert/formats | |
parent | 2cf067473e78844aa616de98bcf0cfcadada2431 (diff) |
Do not try to calculate board conditions if board number is not set
Fixes #4
Diffstat (limited to 'dealconvert/formats')
-rw-r--r-- | dealconvert/formats/pbn.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/dealconvert/formats/pbn.py b/dealconvert/formats/pbn.py index b6c30ed..750d57d 100644 --- a/dealconvert/formats/pbn.py +++ b/dealconvert/formats/pbn.py @@ -95,13 +95,15 @@ class PBNFormat(DealFormat): if deal_obj.has_field('Dealer'): deal_dto.dealer = dealers[deal_obj.get_field('Dealer')] else: - deal_dto.dealer = deal_dto.get_dealer(deal_dto.number) + if deal_dto.number is not None: + deal_dto.dealer = deal_dto.get_dealer(deal_dto.number) if deal_obj.has_field('Vulnerable'): vulnerability = deal_obj.get_field('Vulnerable') for pair in deal_dto.vulnerable: deal_dto.vulnerable[pair] = vulnerability in [pair, 'All'] else: - deal_dto.vulnerable = deal_dto.get_vulnerability(deal_dto.number) + if deal_dto.number is not None: + deal_dto.vulnerable = deal_dto.get_vulnerability(deal_dto.number) deal_parts = deal_obj.get_field('Deal').split(':') dealer = dealers[deal_parts[0]] hands = deal_parts[1].split(' ') |