diff --git a/Job.php b/Job.php index 5d64122..5225d5e 100644 --- a/Job.php +++ b/Job.php @@ -72,7 +72,9 @@ public static function run(InputInterface $input, OutputInterface $output) if ($debug) $next = $calendar->getNextEvent($item['calendar_id'], null, $item['timezone']); } if ($debug) { - if ($timeMatch) { + if (empty($next)) { + $output->writeln("=>No upcoming calendar events"); + } elseif ($timeMatch) { $output->writeln("=>" . $next['startdate'] . " " . $next['starttime'] . " is now"); } else { $output->writeln("=>" . $next['startdate'] . " " . $next['starttime'] . " is not now"); diff --git a/bin/schedtc.php b/bin/schedtc.php index 7458e79..a3b57b6 100755 --- a/bin/schedtc.php +++ b/bin/schedtc.php @@ -71,7 +71,9 @@ if ($debug) $next = $calendar->getNextEvent($item['calendar_id'],null,$item['timezone']); } if ($debug) { - if($timeMatch) { + if(empty($next)) { + tcout($debug, "=>No upcoming calendar events"); + } elseif($timeMatch) { tcout($debug, "=>".$next['startdate']." ".$next['starttime']." is now"); } else { tcout($debug, "=>".$next['startdate']." ".$next['starttime']." is not now");