Skip to content

Commit

Permalink
Check for null value (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
enjinabner authored Aug 21, 2023
1 parent 44ff7be commit 560fc33
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Jobs/CreateBeamClaims.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ public function handle(): void

$this->chunk
->pluck('beam_id', 'beam_id')
->each(
fn ($beamId) => event(
new CreateBeamClaimsCompleted(Beam::select('id', 'code')->find($beamId)->toArray())
)
);
->each(function ($beamId) {
if ($beam = Beam::select('id', 'code')->find($beamId)) {
event(new CreateBeamClaimsCompleted($beam->toArray()));
}
});

unset($this->chunk);
}
Expand Down

0 comments on commit 560fc33

Please sign in to comment.