diff --git a/backend/services/project-management/src/main/java/io/metersphere/project/service/FileAssociationService.java b/backend/services/project-management/src/main/java/io/metersphere/project/service/FileAssociationService.java index 193723b115..f849684c31 100644 --- a/backend/services/project-management/src/main/java/io/metersphere/project/service/FileAssociationService.java +++ b/backend/services/project-management/src/main/java/io/metersphere/project/service/FileAssociationService.java @@ -70,7 +70,7 @@ public class FileAssociationService { //组装返回参数 List responseList = new ArrayList<>(); associationList.forEach(item -> { - if(fileIdMap.containsKey(item.getFileId())){ + if (fileIdMap.containsKey(item.getFileId()) && sourceIdNameMap.containsKey(item.getSourceId())) { FileAssociationResponse response = new FileAssociationResponse(); response.setId(item.getId()); response.setSourceId(item.getSourceId());