From 0cc349d4890dcb41bf49d957b54318d50929e80c Mon Sep 17 00:00:00 2001 From: Michael Erasmus Date: Wed, 1 Jun 2022 14:29:49 -0700 Subject: [PATCH] Handle content errors without a folder --- spectacles/validators/content.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spectacles/validators/content.py b/spectacles/validators/content.py index d7d94a14..8a82af8c 100644 --- a/spectacles/validators/content.py +++ b/spectacles/validators/content.py @@ -60,7 +60,8 @@ def is_folder_selected(folder_id: Optional[str]) -> bool: continue # Sometimes the content no longer exists, in which case the folder is None - folder_id: Optional[str] = content[content_type]["folder"].get("id") + folder = content[content_type].get("folder") + folder_id: Optional[str] = folder.get("id") if folder else None # If exclude_personal isn't specified, personal_folders list is empty if not is_folder_selected(folder_id): continue