mirror of
https://github.com/openvk/openvk
synced 2024-12-22 16:42:32 +03:00
VKAPI: Fix 500 error if the post is published as anon
This commit is contained in:
parent
514b73d41e
commit
4bf6fce260
2 changed files with 2 additions and 2 deletions
|
@ -31,7 +31,7 @@ final class Wall extends VKAPIRequestHandler
|
|||
$attachments[] = [
|
||||
"type" => "photo",
|
||||
"photo" => [
|
||||
"album_id" => $attachment->getAlbum()->getId(),
|
||||
"album_id" => $attachment->getAlbum() ? $attachment->getAlbum()->getId() : null,
|
||||
"date" => $attachment->getPublicationTime()->timestamp(),
|
||||
"id" => $attachment->getVirtualId(),
|
||||
"owner_id" => $attachment->getOwner()->getId(),
|
||||
|
|
|
@ -121,6 +121,6 @@ class Albums
|
|||
{
|
||||
$dbalbum = DatabaseConnection::i()->getContext()->table("album_relations")->where(["media" => $photo->getId()])->fetch();
|
||||
|
||||
return $this->get($dbalbum->collection);
|
||||
return $dbalbum->collection ? $this->get($dbalbum->collection) : null;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue