From ad84cb28f2fa20fc62008a4b093d89f857bdeae7 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Thu, 10 Nov 2022 19:39:38 -0800 Subject: [PATCH] Fix thumbnail_photo return None when photo no longer exists. --- etiquette/objects.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/etiquette/objects.py b/etiquette/objects.py index 6e0e8b5..ccf920b 100644 --- a/etiquette/objects.py +++ b/etiquette/objects.py @@ -737,7 +737,11 @@ class Album(ObjectBase, GroupableMixin): return None if isinstance(self._thumbnail_photo, Photo): return self._thumbnail_photo - photo = self.photodb.get_photo(self._thumbnail_photo) + try: + photo = self.photodb.get_photo(self._thumbnail_photo) + except exceptions.NoSuchPhoto: + self._thumbnail_photo = None + return None self._thumbnail_photo = photo return photo