From 2e222b814b565731fa975a25c6a3599d61f7983c Mon Sep 17 00:00:00 2001 From: Deon George Date: Sun, 5 Jan 2020 18:15:25 +1100 Subject: [PATCH] Fix for when created and created_manual is null --- app/Models/Abstracted/Catalog.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Models/Abstracted/Catalog.php b/app/Models/Abstracted/Catalog.php index c28b7dc..cd9151c 100644 --- a/app/Models/Abstracted/Catalog.php +++ b/app/Models/Abstracted/Catalog.php @@ -286,9 +286,9 @@ abstract class Catalog extends Model return (! is_readable($this->file_path())) ? NULL : filesize($this->file_path()); } - public function getCreatedAttribute(): Carbon + public function getCreatedAttribute() { - return $this->created_manual ?: $this->asDateTime($this->attributes['created']); + return $this->created_manual ?: ($this->attributes['created'] ? $this->asDateTime($this->attributes['created']) : NULL); } /**