diff --git a/code/Controller/AssetAdmin.php b/code/Controller/AssetAdmin.php index 5361ebe5a..0d026ffe5 100644 --- a/code/Controller/AssetAdmin.php +++ b/code/Controller/AssetAdmin.php @@ -710,8 +710,8 @@ public function apiHistory(HTTPRequest $request): HTTPResponse $output[] = array( 'versionid' => (int) $version->Version, - 'date_ago' => $version->dbObject('LastEdited')->Ago(), - 'date_formatted' => $version->dbObject('LastEdited')->Nice(), + 'date_ago' => $version->dbObject('LastEdited')?->Ago(), + 'date_formatted' => $version->dbObject('LastEdited')?->Nice(), 'status' => ($version->WasPublished) ? _t(__CLASS__.'.PUBLISHED', 'Published') : '', 'author' => ($author) ? $author->Name diff --git a/code/Forms/FileHistoryFormFactory.php b/code/Forms/FileHistoryFormFactory.php index 1c90b1f52..b6d2d095b 100644 --- a/code/Forms/FileHistoryFormFactory.php +++ b/code/Forms/FileHistoryFormFactory.php @@ -36,7 +36,7 @@ protected function getSpecsMarkup($record) ? _t(__CLASS__ . '.PUBLISHED', 'Published') : _t(__CLASS__ . '.SAVED', 'Saved'), Convert::raw2att($record->LastEdited), - Convert::raw2xml($record->dbObject('LastEdited')->Ago()) + Convert::raw2xml($record->dbObject('LastEdited')?->Ago()) ); return sprintf( '
%s %s, %s %s
',