Skip to content

Commit 3cdce8c

Browse files
authored
Update Article.php
1 parent 933f4e7 commit 3cdce8c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Entity/Article.php

+4
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,13 @@ public function getDate()
6464
if (!isset($this->data['date'])) {
6565
return null;
6666
}
67+
try {
6768
return (class_exists('\Carbon\Carbon')) ?
6869
new \Carbon\Carbon($this->data['date'], 'GMT') :
6970
$this->data['date'];
71+
} catch (\Exception $e) {
72+
return null;
73+
}
7074
}
7175

7276
/**

0 commit comments

Comments
 (0)