From e0a11da813fe173cd8722196986dcd8b7a75b35b Mon Sep 17 00:00:00 2001 From: song-cc-rock Date: Wed, 23 Oct 2024 18:11:34 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E7=BC=BA=E9=99=B7=E9=83=A8=E5=88=86=E5=AF=8C=E6=96=87=E6=9C=AC?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E6=96=87=E4=BB=B6=E5=90=8D=E7=BC=BA=E5=A4=B1?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1047792 --user=宋昌昌 【缺陷管理】编辑缺陷-点击更新按钮-报SQL异常 https://www.tapd.cn/55049933/s/1596865 --- .../java/io/metersphere/bug/service/BugAttachmentService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugAttachmentService.java b/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugAttachmentService.java index 6a8addd596..75d3cdbc0f 100644 --- a/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugAttachmentService.java +++ b/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugAttachmentService.java @@ -645,7 +645,8 @@ public class BugAttachmentService { addFileMap.put(fileId, fileName); return localAttachment; }).toList(); - bugLocalAttachmentMapper.batchInsert(localAttachments); + List normalAttachments = localAttachments.stream().filter(attachment -> StringUtils.isNotEmpty(attachment.getFileName())).toList(); + bugLocalAttachmentMapper.batchInsert(normalAttachments); // 上传文件到对象存储 LogUtils.info("upload to minio start"); String bugDir = DefaultRepositoryDir.getBugDir(projectId, bugId);