summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2022-06-13 01:08:26 +0200
committeremkael <emkael@tlen.pl>2022-06-13 01:08:26 +0200
commit936590dbdf4e78f7ffe06b5b7858d23e38b600ec (patch)
tree5e37f4e7994e64f48f6769619ff651c39b00df69
parent66d95bb9795f058e67a842a9ba25f7dc3dc0fe47 (diff)
On PBN parsing, skip "deals" without Deal field (like, e.g. multiple empty lines in a file)
-rw-r--r--dealconvert/formats/pbn.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/dealconvert/formats/pbn.py b/dealconvert/formats/pbn.py
index 5c5e769..959ca7b 100644
--- a/dealconvert/formats/pbn.py
+++ b/dealconvert/formats/pbn.py
@@ -83,6 +83,8 @@ class PBNFormat(DealFormat):
for deal in deals:
deal_obj = PBNDeal()
deal_obj.parse(deal)
+ if not deal_obj.has_field('Deal'):
+ continue
deal_dto = dto.Deal()
if deal_obj.has_field('Event'):
deal_dto.event = deal_obj.get_field('Event')