From cd2b68cdacf635807943eec8257103b4f4cef521 Mon Sep 17 00:00:00 2001 From: emkael Date: Fri, 6 May 2016 17:12:20 +0200 Subject: * calendar fetch fallback for empty event list --- app/php/facades/EventFacade.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'app') diff --git a/app/php/facades/EventFacade.php b/app/php/facades/EventFacade.php index 9533448..08133bc 100644 --- a/app/php/facades/EventFacade.php +++ b/app/php/facades/EventFacade.php @@ -59,14 +59,17 @@ class EventFacade extends Facade { } private function _getCalendarsForEvents(array $events) { - return Calendar::finder()->findAllByPks( - array_map( - function($event) { - return $event->CalendarID; - }, - $events - ) - ); + if ($events) { + return Calendar::finder()->findAllByPks( + array_map( + function($event) { + return $event->CalendarID; + }, + $events + ) + ); + } + return []; } } -- cgit v1.2.3