Skip to content

Commit

Permalink
Finer upload check
Browse files Browse the repository at this point in the history
  • Loading branch information
annda committed Mar 7, 2024
1 parent 3f1fb54 commit c7d8fb1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/FormGenerator/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,11 +281,11 @@ protected function submitFormElement(
$formElement->setPreviousValue($previousUpload);

// Re-upload: delete old files first
if (FileHelper::isReupload($newUpload, $previousUpload)) {
if ($newUpload && FileHelper::isReupload($newUpload, $previousUpload)) {
$this->deleteFileFromFormElement($formElement);
}

if (FileHelper::isValidUpload($newUpload)) {
if ($newUpload && FileHelper::isValidUpload($newUpload)) {
/**
* @var UploadedFile $file
*/
Expand Down

0 comments on commit c7d8fb1

Please sign in to comment.