From df6e9bc9b8943b47aa7e648a0bb1238822c8564d Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 24 Jan 2023 07:38:57 +1100 Subject: [PATCH] If not contacts array is passed, do no attempt to modify / save contacts --- app/Repositories/ClientRepository.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Repositories/ClientRepository.php b/app/Repositories/ClientRepository.php index 9d5a0c757d78..004eece6e6be 100644 --- a/app/Repositories/ClientRepository.php +++ b/app/Repositories/ClientRepository.php @@ -102,7 +102,8 @@ class ClientRepository extends BaseRepository $data['name'] = $client->present()->name(); } - $this->contact_repo->save($contact_data, $client); + if(array_key_exists('contacts', $contact_data)) + $this->contact_repo->save($contact_data, $client); return $client; }