[HttpFoundation] Check file exists before unlink

This commit is contained in:
adam-mospan 2019-01-03 17:40:56 +02:00 committed by Nicolas Grekas
parent a1a3ffc1b9
commit 1954187fac

View File

@ -305,7 +305,7 @@ class BinaryFileResponse extends Response
fclose($out);
fclose($file);
if ($this->deleteFileAfterSend) {
if ($this->deleteFileAfterSend && file_exists($this->file->getPathname())) {
unlink($this->file->getPathname());
}