diff --git a/src/Domains/Connectors/Zoho/Workflows/ZohoLeadActivity.php b/src/Domains/Connectors/Zoho/Workflows/ZohoLeadActivity.php index a54a4beaa..0a3e38c21 100644 --- a/src/Domains/Connectors/Zoho/Workflows/ZohoLeadActivity.php +++ b/src/Domains/Connectors/Zoho/Workflows/ZohoLeadActivity.php @@ -125,11 +125,11 @@ protected function assignAgent( } if ($agentInfo->user && ! empty($agentInfo->user->get('sponsor'))) { - $zohoData['Sponsor'] = (string) $agent->user->get('sponsor'); + $zohoData['Sponsor'] = (string) $agentInfo->user->get('sponsor'); } } - if ($company->get(CustomFieldEnum::ZOHO_USE_AGENT_NAME->value)) { + if ($company->get(CustomFieldEnum::ZOHO_USE_AGENT_NAME->value) && ! empty($agentInfo->name)) { $zohoData['Agent_Name'] = $agentInfo->name; }