From 878df31084b35caaddbd1ac544d54beb8a7602b3 Mon Sep 17 00:00:00 2001 From: mrilyew <99399973+mrilyew@users.noreply.github.com> Date: Tue, 27 May 2025 22:29:24 +0300 Subject: [PATCH] fix(photos): don't check rights of deleted album --- Web/Models/Entities/Photo.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Web/Models/Entities/Photo.php b/Web/Models/Entities/Photo.php index 57ab2b8a..b0ee2e83 100644 --- a/Web/Models/Entities/Photo.php +++ b/Web/Models/Entities/Photo.php @@ -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