From 15a5f172d994cb2f8d69e4d1fccacf0bf84d502c Mon Sep 17 00:00:00 2001 From: veselcraft Date: Sat, 28 Oct 2023 13:24:32 +0300 Subject: [PATCH] VKAPI: Change Friends.get behaviour if user not found --- VKAPI/Handlers/Friends.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/VKAPI/Handlers/Friends.php b/VKAPI/Handlers/Friends.php index f7873520..56de3294 100644 --- a/VKAPI/Handlers/Friends.php +++ b/VKAPI/Handlers/Friends.php @@ -13,6 +13,10 @@ final class Friends extends VKAPIRequestHandler $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();