diff options
Diffstat (limited to 'app/controllers/contact.php')
| -rw-r--r-- | app/controllers/contact.php | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/app/controllers/contact.php b/app/controllers/contact.php index 7dd2b05..2148777 100644 --- a/app/controllers/contact.php +++ b/app/controllers/contact.php @@ -189,9 +189,21 @@ class ContactController extends AuthenticatedController $user = User::findManyByUsername(Request::getArray('user')); } if ($group) { - $user = User::findMany(Statusgruppen::find($group)->members->pluck('user_id')); + $group_object = Statusgruppen::find($group); + if (!$group_object) { + $this->set_status(404); + $this->render_nothing(); + return; + } + $user = User::findMany($group_object->members->pluck('user_id')); } if (!$user) { + $user_object = User::findCurrent(); + if (!$user_object) { + $this->set_status(404); + $this->render_nothing(); + return; + } $user = User::findCurrent()->contacts; } |
