mirror of
https://github.com/openvk/openvk
synced 2024-12-22 16:42:32 +03:00
fix(api): 500 error if user from repost does not exist
This commit is contained in:
parent
5b8fe91a33
commit
1625557e24
1 changed files with 22 additions and 13 deletions
|
@ -435,19 +435,28 @@ final class Wall extends VKAPIRequestHandler
|
||||||
|
|
||||||
foreach($profiles as $prof) {
|
foreach($profiles as $prof) {
|
||||||
$user = (new UsersRepo)->get($prof);
|
$user = (new UsersRepo)->get($prof);
|
||||||
$profilesFormatted[] = (object)[
|
if($user) {
|
||||||
"first_name" => $user->getFirstName(),
|
$profilesFormatted[] = (object)[
|
||||||
"id" => $user->getId(),
|
"first_name" => $user->getFirstName(),
|
||||||
"last_name" => $user->getLastName(),
|
"id" => $user->getId(),
|
||||||
"can_access_closed" => false,
|
"last_name" => $user->getLastName(),
|
||||||
"is_closed" => false,
|
"can_access_closed" => false,
|
||||||
"sex" => $user->isFemale() ? 1 : ($user->isNeutral() ? 0 : 2),
|
"is_closed" => false,
|
||||||
"screen_name" => $user->getShortCode(),
|
"sex" => $user->isFemale() ? 1 : 2,
|
||||||
"photo_50" => $user->getAvatarUrl(),
|
"screen_name" => $user->getShortCode(),
|
||||||
"photo_100" => $user->getAvatarUrl(),
|
"photo_50" => $user->getAvatarUrl(),
|
||||||
"online" => $user->isOnline(),
|
"photo_100" => $user->getAvatarUrl(),
|
||||||
"verified" => $user->isVerified()
|
"online" => $user->isOnline(),
|
||||||
];
|
"verified" => $user->isVerified()
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
$profilesFormatted[] = (object)[
|
||||||
|
"id" => (int) $prof,
|
||||||
|
"first_name" => "DELETED",
|
||||||
|
"last_name" => "",
|
||||||
|
"deactivated" => "deleted"
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($groups as $g) {
|
foreach($groups as $g) {
|
||||||
|
|
Loading…
Reference in a new issue