From 6acd892116b4e54cdc12d8cfe9082859f16f9161 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Mon, 26 Jun 2023 20:18:36 +0200 Subject: [PATCH] fixed broken image would fail default importer --- cookbook/integration/default.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cookbook/integration/default.py b/cookbook/integration/default.py index 951a5312c1..5939b5f47e 100644 --- a/cookbook/integration/default.py +++ b/cookbook/integration/default.py @@ -1,4 +1,5 @@ import json +import traceback from io import BytesIO, StringIO from re import match from zipfile import ZipFile @@ -19,7 +20,10 @@ def get_recipe_from_file(self, file): recipe = self.decode_recipe(recipe_string) images = list(filter(lambda v: match('image.*', v), recipe_zip.namelist())) if images: - self.import_recipe_image(recipe, BytesIO(recipe_zip.read(images[0])), filetype=get_filetype(images[0])) + try: + self.import_recipe_image(recipe, BytesIO(recipe_zip.read(images[0])), filetype=get_filetype(images[0])) + except AttributeError as e: + traceback.print_exc() return recipe def decode_recipe(self, string):