From 2358bc42c56a036015eb4ed5e7e7298f7c31eb6d Mon Sep 17 00:00:00 2001 From: "Phyks (Lucas Verney)" Date: Sun, 16 May 2021 15:02:20 +0200 Subject: [PATCH] Fix issue #138 --- flatisfy/email.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/flatisfy/email.py b/flatisfy/email.py index 8fceb4c..c2d5c6f 100644 --- a/flatisfy/email.py +++ b/flatisfy/email.py @@ -97,8 +97,14 @@ def send_notification(config, flats): for flat in flats: title = str(flat.title) flat_id = str(flat.id) - area = str(int(flat.area)) - cost = int(flat.cost) + try: + area = str(int(flat.area)) + except (TypeError, ValueError): + area = None + try: + cost = int(flat.cost) + except (TypeError, ValueError): + cost = None currency = str(flat.currency) txt += f"- {title}: {website_url}#/flat/{flat_id} "