From 3799ab52455272fb11d491a0aa303baceffe8237 Mon Sep 17 00:00:00 2001 From: Alaa Alsalehi Date: Tue, 31 Oct 2023 12:33:54 +0200 Subject: [PATCH] fix(settings): appending the me-contact only if it is not null (#6728) Co-authored-by: Alexis Saettler --- app/Http/Controllers/SettingsController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.php index 1ef753a542e..b41cdd0f4f0 100644 --- a/app/Http/Controllers/SettingsController.php +++ b/app/Http/Controllers/SettingsController.php @@ -59,7 +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); - $existingContacts->prepend($meContact); + if ($meContact) { + $existingContacts->prepend($meContact); + } } $accountHasLimitations = AccountHelper::hasLimitations(auth()->user()->account);