Merge pull request #3645 from thabaum/file-controller-upload-null

Handle null or empty formfile in UploadFile Method - Fixes #3646
This commit is contained in:
Shaun Walker 2024-01-15 08:55:04 -05:00 committed by GitHub
commit bcc216fd2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -360,7 +360,7 @@ namespace Oqtane.Controllers
[HttpPost("upload")]
public async Task UploadFile(string folder, IFormFile formfile)
{
if (formfile.Length <= 0)
if (formfile == null || formfile.Length <= 0)
{
return;
}