From 35bb6b62d85b0fec6891b44545a17ea1f12e78f9 Mon Sep 17 00:00:00 2001 From: Cody Date: Fri, 12 Jan 2024 14:08:15 -0800 Subject: [PATCH] Handle null or empty formfile in UploadFile Method --- Oqtane.Server/Controllers/FileController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Oqtane.Server/Controllers/FileController.cs b/Oqtane.Server/Controllers/FileController.cs index 65cd3fec..cc56366c 100644 --- a/Oqtane.Server/Controllers/FileController.cs +++ b/Oqtane.Server/Controllers/FileController.cs @@ -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; }