From eed6e9d3a5b07e3109656f88f4a4556afc4ddb70 Mon Sep 17 00:00:00 2001 From: smilerz Date: Thu, 4 Mar 2021 15:30:20 -0600 Subject: [PATCH] catch index error --- cookbook/helper/recipe_url_import.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cookbook/helper/recipe_url_import.py b/cookbook/helper/recipe_url_import.py index 3e0620916..d9be51962 100644 --- a/cookbook/helper/recipe_url_import.py +++ b/cookbook/helper/recipe_url_import.py @@ -232,7 +232,7 @@ def get_from_scraper(scrape): recipe_json['prepTime'] = _utils.get_minutes(scrape.schema.data.get("prepTime")) or 0 recipe_json['cookTime'] = _utils.get_minutes(scrape.schema.data.get("cookTime")) or 0 except AttributeError: - recipe_json['description'] = '' + description = '' recipe_json['prepTime'] = 0 recipe_json['cookTime'] = 0 @@ -242,7 +242,7 @@ def get_from_scraper(scrape): try: servings = scrape.yields() servings = int(re.findall(r'\b\d+\b', servings)[0]) - except (AttributeError, ValueError): + except (AttributeError, ValueError, IndexError): servings = 1 recipe_json['servings'] = servings