mirror of
https://github.com/openvk/openvk
synced 2025-01-09 01:09:46 +03:00
VKAPI: Fix 500 error if some peers_id is invalid
This commit is contained in:
parent
ca27e0588a
commit
c3610cdd4d
1 changed files with 28 additions and 26 deletions
|
@ -247,6 +247,7 @@ final class Messages extends VKAPIRequestHandler
|
|||
|
||||
$user = (new USRRepo)->get((int) $peer);
|
||||
|
||||
if($user) {
|
||||
$dialogue = new Correspondence($this->getUser(), $user);
|
||||
$iterator = $dialogue->getMessages(Correspondence::CAP_BEHAVIOUR_START_MESSAGE_ID, 0, 1, 0, false);
|
||||
$msg = $iterator[0]->unwrap(); // шоб удобнее было
|
||||
|
@ -274,6 +275,7 @@ final class Messages extends VKAPIRequestHandler
|
|||
];
|
||||
$userslist[] = $user->getId();
|
||||
}
|
||||
}
|
||||
|
||||
if($extended == 1) {
|
||||
$userslist = array_unique($userslist);
|
||||
|
|
Loading…
Reference in a new issue