Skip to content

Commit

Permalink
Prevent normal Job from fatal error
Browse files Browse the repository at this point in the history
  • Loading branch information
imTigger committed May 29, 2017
1 parent df928a3 commit 9e0fb98
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/LaravelJobStatusServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ private function updateJobStatus(Job $job, array $data)
try {
$payload = $job->payload();
$jobStatus = unserialize($payload['data']['command']);

if (!is_callable([$jobStatus, 'getJobStatusId'])) {
return;
}

$jobStatusId = $jobStatus->getJobStatusId();

$jobStatus = JobStatus::where('id', '=', $jobStatusId);
Expand Down

0 comments on commit 9e0fb98

Please sign in to comment.