8000 [File Uploads] Check if the entity contains the files · symfony/symfony-docs@cc0d418 · GitHub
[go: up one dir, main page]

Skip to content

Commit cc0d418

Browse files
Guikingonexabbuh
authored andcommitted
[File Uploads] Check if the entity contains the files
1 parent ca786e9 commit cc0d418

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

controller/upload_file.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -456,9 +456,9 @@ controller.
456456
return;
457457
}
458458

459-
$fileName = $entity->getBrochure();
460-
461-
$entity->setBrochure(new File($this->uploader->getTargetDir().'/'.$fileName));
459+
if ($fileName = $entity->getBrochure()) {
460+
$entity->setBrochure(new File($this->uploader->getTargetDir().'/'.$fileName));
461+
}
462462
}
463463
}
464464

0 commit comments

Comments
 (0)
0