Fix thumbnail_photo return None when photo no longer exists.

This commit is contained in:
voussoir 2022-11-10 19:39:38 -08:00
parent adad4da086
commit ad84cb28f2

View file

@ -737,7 +737,11 @@ class Album(ObjectBase, GroupableMixin):
return None return None
if isinstance(self._thumbnail_photo, Photo): if isinstance(self._thumbnail_photo, Photo):
return self._thumbnail_photo return self._thumbnail_photo
try:
photo = self.photodb.get_photo(self._thumbnail_photo) photo = self.photodb.get_photo(self._thumbnail_photo)
except exceptions.NoSuchPhoto:
self._thumbnail_photo = None
return None
self._thumbnail_photo = photo self._thumbnail_photo = photo
return photo return photo