From c8395f43dda60a79b51ab56643d6dee9b22c5e98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= Date: Sun, 12 May 2019 22:41:40 +0000 Subject: [PATCH] fix(ftrack): check if asset is in avalon db before trying to delete it, throw sanitized error otherwise --- pype/ftrack/actions/action_delete_asset.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pype/ftrack/actions/action_delete_asset.py b/pype/ftrack/actions/action_delete_asset.py index eabadecee6..96087f4c8e 100644 --- a/pype/ftrack/actions/action_delete_asset.py +++ b/pype/ftrack/actions/action_delete_asset.py @@ -85,6 +85,12 @@ class DeleteAsset(BaseAction): 'type': 'asset', 'name': entity['name'] }) + + if av_entity is None: + return { + 'success': False, + 'message': 'Didn\'t found assets in avalon' + } asset_label = { 'type': 'label',