From 1e17f3703a5e6e301bc4133282aa2fa8d777cf9f Mon Sep 17 00:00:00 2001 From: smilerz Date: Wed, 14 Apr 2021 19:28:46 -0500 Subject: [PATCH] trap error on scrape.title() --- cookbook/helper/recipe_url_import.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cookbook/helper/recipe_url_import.py b/cookbook/helper/recipe_url_import.py index cd9e33a72..6cdf0107c 100644 --- a/cookbook/helper/recipe_url_import.py +++ b/cookbook/helper/recipe_url_import.py @@ -13,7 +13,10 @@ def get_from_scraper(scrape, space): # converting the scrape_me object to the existing json format based on ld+json recipe_json = {} - recipe_json['name'] = scrape.title() + try: + recipe_json['name'] = scrape.title() + except TypeError: + recipe_json['name'] = '' try: description = scrape.schema.data.get("description") or ''