fix(photos): don't check rights of deleted album

This commit is contained in:
mrilyew 2025-05-27 22:29:24 +03:00 committed by Alexander Minkin
parent 1a03a31dfa
commit 878df31084

View file

@ -336,7 +336,12 @@ class Photo extends Media
public function getAlbum(): ?Album
{
return (new Albums())->getAlbumByPhotoId($this);
$album = (new Albums())->getAlbumByPhotoId($this);
if (!$album || $album->isDeleted()) {
return null;
}
return $album;
}
public function toVkApiStruct(bool $photo_sizes = true, bool $extended = false): object