From 9100a83044aee90822f3172b34fc11f1daa82691 Mon Sep 17 00:00:00 2001 From: mrilyew <99399973+mrilyew@users.noreply.github.com> Date: Tue, 5 Nov 2024 15:10:12 +0300 Subject: [PATCH] fix(users/groups): fix 500 if unauthorized --- Web/Models/Entities/Traits/TIgnorable.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Web/Models/Entities/Traits/TIgnorable.php b/Web/Models/Entities/Traits/TIgnorable.php index b55ea926..3e21420b 100644 --- a/Web/Models/Entities/Traits/TIgnorable.php +++ b/Web/Models/Entities/Traits/TIgnorable.php @@ -5,8 +5,11 @@ use openvk\Web\Models\Entities\User; trait TIgnorable { - function isIgnoredBy(User $user): bool + function isIgnoredBy(User $user = NULL): bool { + if(!$user) + return false; + $ctx = DatabaseConnection::i()->getContext(); $data = [ "owner" => $user->getId(),