From 6b91808987f2c814489a43f3ad1864f2fb64c2ed Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Thu, 23 Sep 2021 14:08:29 +0200 Subject: [PATCH] fix error with doctrine:fixtures:load --- .../ChillCalendarBundle/Event/ListenToActivityCreate.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 +}