1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-21 08:51:34 +02:00

Merge pull request #5791 from turbo124/v5-develop

return first() instead of exists()
This commit is contained in:
David Bomba 2021-05-22 16:33:44 +10:00 committed by GitHub
commit 78f6e1cb86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1661,7 +1661,7 @@ class Import implements ShouldQueue
$ninja_company = Company::find(config('ninja.ninja_default_company_id'));
/* If we already have a record of this user - move along. */
if($client_contact = ClientContact::where(['email' => $owner->email, 'company_id' => $ninja_company->id])->exists())
if($client_contact = ClientContact::where(['email' => $owner->email, 'company_id' => $ninja_company->id])->first())
return $client_contact->client;
$ninja_client = ClientFactory::create($ninja_company->id, $ninja_company->owner()->id);