From a2d6b1b595e0e18382357266f2126537f1106ab4 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Fri, 6 Jan 2023 10:18:48 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8Dcase=E5=85=B3=E8=81=94=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=BA=93=E6=96=87=E4=BB=B6=E6=8A=A5=E7=A9=BA=E6=8C=87=E9=92=88?= =?UTF-8?q?=E7=9A=84=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/metersphere/commons/utils/ApiFileUtil.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/api-test/backend/src/main/java/io/metersphere/commons/utils/ApiFileUtil.java b/api-test/backend/src/main/java/io/metersphere/commons/utils/ApiFileUtil.java index c262bddd6c..5075fac084 100644 --- a/api-test/backend/src/main/java/io/metersphere/commons/utils/ApiFileUtil.java +++ b/api-test/backend/src/main/java/io/metersphere/commons/utils/ApiFileUtil.java @@ -50,8 +50,10 @@ public class ApiFileUtil extends FileUtils { if (fileManagerService == null) { fileManagerService = CommonBeanFactory.getBean(FileManagerService.class); } - for (MultipartFile bodyFile : bodyFiles) { - fileManagerService.upload(bodyFile, getRequest(requestId)); + if (CollectionUtils.isNotEmpty(bodyFiles) && StringUtils.isNotBlank(requestId)) { + for (MultipartFile bodyFile : bodyFiles) { + fileManagerService.upload(bodyFile, getRequest(requestId)); + } } }