Fix thumbnail_photo return None when photo no longer exists.
This commit is contained in:
parent
adad4da086
commit
ad84cb28f2
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||||
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
|
self._thumbnail_photo = photo
|
||||||
return photo
|
return photo
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue