diff --git a/src/Bundle/ChillCalendarBundle/Event/ListenToActivityCreate.php b/src/Bundle/ChillCalendarBundle/Event/ListenToActivityCreate.php index 76a47015d..f3c4e7a59 100644 --- a/src/Bundle/ChillCalendarBundle/Event/ListenToActivityCreate.php +++ b/src/Bundle/ChillCalendarBundle/Event/ListenToActivityCreate.php @@ -20,6 +20,11 @@ class ListenToActivityCreate { // Get the calendarId from the request $request = $this->requestStack->getCurrentRequest(); + + if (null === $request) { + return; + } + if ($request->query->has('activityData')) { $activityData = $request->query->get('activityData'); if (array_key_exists('calendarId', $activityData)) { @@ -37,4 +42,4 @@ class ListenToActivityCreate $em->flush(); } -} \ No newline at end of file +}