Skip to content

Commit

Permalink
Merge pull request #12 from krichprollsch/test-location
Browse files Browse the repository at this point in the history
test if location exists into data
  • Loading branch information
Taluu committed Jan 27, 2016
2 parents e166ecb + 717de79 commit e87d72a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Model/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);

Expand Down

0 comments on commit e87d72a

Please sign in to comment.