Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 2e5e3ea

Browse files
committed
ADD throwFileErrorException null value support
1 parent 230ec57 commit 2e5e3ea

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎src/utils/HttpHelper.php‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,8 +402,11 @@ public static function isFileExceededSize(UploadedFileInterface $file, int $maxS
402402
return $file->getSize() > $maxSize;
403403
}
404404

405-
public static function throwFileErrorException(UploadedFileInterface $file)
405+
public static function throwFileErrorException(?UploadedFileInterface $file)
406406
{
407+
if (is_null($file)) {
408+
throw new UploadFileMissedException();
409+
}
407410
switch ($file->getError()) {
408411
case UPLOAD_ERR_INI_SIZE:
409412
throw new UploadFileExceedsIniMaxSizeException();

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /