From 717de79a66c42eb45dd90f6dcbe13cc1a255f5f0 Mon Sep 17 00:00:00 2001 From: Pierre Tachoire Date: Wed, 27 Jan 2016 14:26:46 +0100 Subject: [PATCH] test if location exists into data --- src/Model/Event.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Model/Event.php b/src/Model/Event.php index 8056ec8..2ba786c 100644 --- a/src/Model/Event.php +++ b/src/Model/Event.php @@ -265,7 +265,10 @@ public static function hydrate(array $data, Calendar $calendar = null) $event->description = $data['BodyPreview']; } - $event->location = $data['Location']['DisplayName']; + if (isset($data['Location']) && isset($data['Location']['DisplayName'])) { + $event->location = $data['Location']['DisplayName']; + } + $event->createdAt = new Datetime($data['DateTimeCreated']); $event->updatedAt = new Datetime($data['DateTimeLastModified']);