Skip to content

Commit

Permalink
VKAPI: Change Friends.get behaviour if user not found
Browse files Browse the repository at this point in the history
  • Loading branch information
veselcraft committed Oct 28, 2023
1 parent cd7b51f commit 15a5f17
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions VKAPI/Handlers/Friends.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ function get(int $user_id, string $fields = "", int $offset = 0, int $count = 10
$users = new UsersRepo;

$this->requireUser();

if (is_null($users->get($user_id))) {
$this->fail(100, "One of the parameters specified was missing or invalid");
}

foreach($users->get($user_id)->getFriends($offset, $count) as $friend) {
$friends[$i] = $friend->getId();
Expand Down

0 comments on commit 15a5f17

Please sign in to comment.