From c9b4d7c59e2ed2c25dd6a8f17dc4f71564d6b7fe Mon Sep 17 00:00:00 2001 From: addshore Date: Sun, 28 Jul 2024 12:35:17 +0100 Subject: [PATCH] Account for empty or missing YAML stuff --- app/Console/Kernel.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index de88929..7174ae5 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -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,