Skip to content

Commit

Permalink
[5.x] Throw better exception when asset isn't found (#11321)
Browse files Browse the repository at this point in the history
  • Loading branch information
edalzell authored Jan 7, 2025
1 parent c2ed1ce commit b63e958
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Fieldtypes/Assets/Assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit b63e958

Please sign in to comment.