From be70af4ed4099fa3b3ca5026ed0fec5112b2fa2c Mon Sep 17 00:00:00 2001 From: alaa-alsalehi Date: Fri, 30 Jun 2023 17:28:29 +0300 Subject: [PATCH 1/2] fix(settings):appending the me-contact only if it is not null --- app/Http/Controllers/SettingsController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.php index 1ef753a542e..4452a602263 100644 --- a/app/Http/Controllers/SettingsController.php +++ b/app/Http/Controllers/SettingsController.php @@ -59,7 +59,8 @@ public function index() if (auth()->user()->me_contact_id) { $meContact = Contact::where('account_id', auth()->user()->account_id) ->find(auth()->user()->me_contact_id); - $existingContacts->prepend($meContact); + if ($meContact) + $existingContacts->prepend($meContact); } $accountHasLimitations = AccountHelper::hasLimitations(auth()->user()->account); From 2ff431312a951b1264f1c5362cdab9d46fe1016f Mon Sep 17 00:00:00 2001 From: Alaa Alsalehi Date: Thu, 31 Aug 2023 14:37:29 +0300 Subject: [PATCH 2/2] Update app/Http/Controllers/SettingsController.php Co-authored-by: Alexis Saettler --- app/Http/Controllers/SettingsController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.php index 4452a602263..b41cdd0f4f0 100644 --- a/app/Http/Controllers/SettingsController.php +++ b/app/Http/Controllers/SettingsController.php @@ -59,8 +59,9 @@ public function index() if (auth()->user()->me_contact_id) { $meContact = Contact::where('account_id', auth()->user()->account_id) ->find(auth()->user()->me_contact_id); - if ($meContact) + if ($meContact) { $existingContacts->prepend($meContact); + } } $accountHasLimitations = AccountHelper::hasLimitations(auth()->user()->account);