Handle null or empty formfile in UploadFile Method

This commit is contained in:
Cody 2024-01-12 14:08:15 -08:00 committed by GitHub
parent c284edcd81
commit 35bb6b62d8
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;
}