From a1c0b89d6eb657c4b77a0b4b05bd0fa15f2935cf Mon Sep 17 00:00:00 2001 From: Julia Lange Date: Tue, 30 May 2023 13:33:23 +0200 Subject: [PATCH] chore: make sure provided data is already of type asset --- src/Tags/Picture.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Tags/Picture.php b/src/Tags/Picture.php index 124a1e7..89403b4 100644 --- a/src/Tags/Picture.php +++ b/src/Tags/Picture.php @@ -65,8 +65,10 @@ public function __call($method, $args): string protected function output($asset) { - if (! $asset = Asset::find($asset)) { - return ''; + if (! is_a($asset, 'Statamic\Contracts\Assets\Asset')) { + if (! $asset = Asset::find($asset)) { + return ''; + } } $picture = new Picturesque($asset);