Skip to content

Commit b63e958

Browse files
authored
[5.x] Throw better exception when asset isn't found (#11321)
1 parent c2ed1ce commit b63e958

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Fieldtypes/Assets/Assets.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public function process($data)
161161
$max_files = (int) $this->config('max_files');
162162

163163
$values = collect($data)->map(function ($id) {
164-
return Asset::find($id)->path();
164+
return Asset::findOrFail($id)->path();
165165
});
166166

167167
return $this->config('max_files') === 1 ? $values->first() : $values->all();

0 commit comments

Comments
 (0)