From 936590dbdf4e78f7ffe06b5b7858d23e38b600ec Mon Sep 17 00:00:00 2001 From: emkael Date: Mon, 13 Jun 2022 01:08:26 +0200 Subject: On PBN parsing, skip "deals" without Deal field (like, e.g. multiple empty lines in a file) --- dealconvert/formats/pbn.py | 2 ++ 1 file changed, 2 insertions(+) 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') -- cgit v1.2.3