From b63e958b0fc969608f2762dd4c05a32f9134f5fc Mon Sep 17 00:00:00 2001 From: Erin Dalzell Date: Tue, 7 Jan 2025 11:39:50 -0800 Subject: [PATCH] [5.x] Throw better exception when asset isn't found (#11321) --- src/Fieldtypes/Assets/Assets.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Fieldtypes/Assets/Assets.php b/src/Fieldtypes/Assets/Assets.php index a58efcfea8..3e4adc9985 100644 --- a/src/Fieldtypes/Assets/Assets.php +++ b/src/Fieldtypes/Assets/Assets.php @@ -161,7 +161,7 @@ public function process($data) $max_files = (int) $this->config('max_files'); $values = collect($data)->map(function ($id) { - return Asset::find($id)->path(); + return Asset::findOrFail($id)->path(); }); return $this->config('max_files') === 1 ? $values->first() : $values->all();