diff --git a/src/AssetControlExtension.php b/src/AssetControlExtension.php index 32e77890..ac1a7790 100644 --- a/src/AssetControlExtension.php +++ b/src/AssetControlExtension.php @@ -247,7 +247,7 @@ protected function findAssets(DataObject $record) } // Omit variant and merge with set - $next = $record->dbObject($field)->getValue(); + $next = $record->dbObject($field)?->getValue(); unset($next['Variant']); if ($next) { $files[] = $next; diff --git a/src/File.php b/src/File.php index 03fca21b..3739b382 100644 --- a/src/File.php +++ b/src/File.php @@ -1322,16 +1322,14 @@ public function forTemplate(): string /** * Return a html5 tag of the appropriate for this file (normally img or a) - * - * @return string */ - public function getTag() + public function getTag(): string { $template = $this->File->getFrontendTemplate(); if (empty($template)) { return ''; } - return (string)$this->renderWith($template); + return $this->renderWith($template); } /**