Skip to content

Commit

Permalink
[5.x] Fix error with Files Fieldtype in Forms when no files are uploa…
Browse files Browse the repository at this point in the history
…ded (#10585)
  • Loading branch information
duncanmcclean authored Aug 7, 2024
1 parent a033f0b commit 54285fe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Forms/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ private function attachFiles($field)
? collect([$value])->filter()
: $value;

if (! $value) {
return;
}

foreach ($value as $file) {
$this->attachFromStorageDisk('local', 'statamic/file-uploads/'.$file);
}
Expand Down

0 comments on commit 54285fe

Please sign in to comment.