diff --git a/app/app/Jobs/Bot/ProcessChatMessageJob.php b/app/app/Jobs/Bot/ProcessChatMessageJob.php index 75bf1514..e5269dd6 100644 --- a/app/app/Jobs/Bot/ProcessChatMessageJob.php +++ b/app/app/Jobs/Bot/ProcessChatMessageJob.php @@ -120,8 +120,8 @@ class ProcessChatMessageJob implements ShouldQueue ->all(); $client = $rows->firstWhere(fn (BotDialog $d) => $d->direction === 'in'); - $source = (string) ($client->source ?? 'portal'); - $userId = $client->user_id !== null ? (int) $client->user_id : null; + $source = (string) ($client?->source ?? 'portal'); + $userId = $client?->user_id !== null ? (int) $client?->user_id : null; $to = (string) config('services.support.email'); if ($to !== '') {