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);