diff --git a/Calendar.class.php b/Calendar.class.php index 3fe88c7..f4cd5ae 100644 --- a/Calendar.class.php +++ b/Calendar.class.php @@ -1112,13 +1112,13 @@ public function getNextEventByGroup($groupid, $now = null, $timezone = null) $cal = $this->getDriverById($calid); $cal->setTimezone($timezone); $cal->setNow($now); - $ev = $cal->getNextEvent($cal); + $ev = $cal->getNextEvent(); if (!empty($ev)) { $events[$ev['startdate']] = $ev; } } ksort($events); - return reset($events); + return !empty($events) ? reset($events) : []; } /**