mirror of
https://github.com/openvk/openvk
synced 2024-12-23 09:01:15 +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);
|
$user = (new USRRepo)->get((int) $peer);
|
||||||
|
|
||||||
|
if($user) {
|
||||||
$dialogue = new Correspondence($this->getUser(), $user);
|
$dialogue = new Correspondence($this->getUser(), $user);
|
||||||
$iterator = $dialogue->getMessages(Correspondence::CAP_BEHAVIOUR_START_MESSAGE_ID, 0, 1, 0, false);
|
$iterator = $dialogue->getMessages(Correspondence::CAP_BEHAVIOUR_START_MESSAGE_ID, 0, 1, 0, false);
|
||||||
$msg = $iterator[0]->unwrap(); // шоб удобнее было
|
$msg = $iterator[0]->unwrap(); // шоб удобнее было
|
||||||
|
@ -274,6 +275,7 @@ final class Messages extends VKAPIRequestHandler
|
||||||
];
|
];
|
||||||
$userslist[] = $user->getId();
|
$userslist[] = $user->getId();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if($extended == 1) {
|
if($extended == 1) {
|
||||||
$userslist = array_unique($userslist);
|
$userslist = array_unique($userslist);
|
||||||
|
|
Loading…
Reference in a new issue