mirror of
https://github.com/openvk/openvk
synced 2024-11-11 09:29:29 +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[] = [
|
$attachments[] = [
|
||||||
"type" => "photo",
|
"type" => "photo",
|
||||||
"photo" => [
|
"photo" => [
|
||||||
"album_id" => $attachment->getAlbum()->getId(),
|
"album_id" => $attachment->getAlbum() ? $attachment->getAlbum()->getId() : null,
|
||||||
"date" => $attachment->getPublicationTime()->timestamp(),
|
"date" => $attachment->getPublicationTime()->timestamp(),
|
||||||
"id" => $attachment->getVirtualId(),
|
"id" => $attachment->getVirtualId(),
|
||||||
"owner_id" => $attachment->getOwner()->getId(),
|
"owner_id" => $attachment->getOwner()->getId(),
|
||||||
|
|
|
@ -121,6 +121,6 @@ class Albums
|
||||||
{
|
{
|
||||||
$dbalbum = DatabaseConnection::i()->getContext()->table("album_relations")->where(["media" => $photo->getId()])->fetch();
|
$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