diff --git a/src/Jobs/DispatchCreateBeamClaimsJobs.php b/src/Jobs/DispatchCreateBeamClaimsJobs.php index 3a89459..7b2031f 100644 --- a/src/Jobs/DispatchCreateBeamClaimsJobs.php +++ b/src/Jobs/DispatchCreateBeamClaimsJobs.php @@ -12,6 +12,7 @@ use Illuminate\Support\Collection; use Illuminate\Support\LazyCollection; use Illuminate\Support\Arr; +use Illuminate\Support\Facades\Log; class DispatchCreateBeamClaimsJobs implements ShouldQueue { @@ -38,6 +39,13 @@ public function __construct( public function handle(): void { $beam = $this->beam->load('collection'); + if (!$beam?->collection) { + Log::error('Beam collection not found', ['beam_id' => $beam->id]); + + return; + } + + $tokens = collect($this->tokens); $tokens->chunk(1000)