From 7625dadab2221b41df8e303b747c565ffb8438b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20=C5=A0kvorc?= Date: Sat, 8 Jul 2017 19:35:51 +0200 Subject: [PATCH] Update Article.php --- src/Entity/Article.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Entity/Article.php b/src/Entity/Article.php index 4ecbf3a..e2322be 100644 --- a/src/Entity/Article.php +++ b/src/Entity/Article.php @@ -61,6 +61,9 @@ public function getHtml() */ public function getDate() { + if (!isset($this->data['date'])) { + return null; + } return (class_exists('\Carbon\Carbon')) ? new \Carbon\Carbon($this->data['date'], 'GMT') : $this->data['date']; @@ -268,4 +271,4 @@ public function getEstimatedDate() new \Carbon\Carbon($date, 'GMT') : $date; } -} \ No newline at end of file +}