Skip to content

Commit

Permalink
Account for empty or missing YAML stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
addshore committed Jul 28, 2024
1 parent c6fbb40 commit c9b4d7c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@ protected function schedule(Schedule $schedule)
}
}
foreach( $depictsJobs as $job ) {
// Make sure that job is an object
if( !is_object( $job ) ) {
echo "Job is not an object\n";
continue;
}
// Make sure it has the required fields
if( !isset( $job->category ) || !isset( $job->depictsId ) || !isset( $job->name ) || !isset( $job->limit ) ) {
echo "Job is missing required fields\n";
continue;
}
$schedule->job(
new GenerateDepictsQuestions(
$job->category,
Expand Down

0 comments on commit c9b4d7c

Please sign in to comment.