diff --git a/test-track/backend/src/main/java/io/metersphere/controller/IssuesController.java b/test-track/backend/src/main/java/io/metersphere/controller/IssuesController.java index 0df79dfbe6..734f08075f 100644 --- a/test-track/backend/src/main/java/io/metersphere/controller/IssuesController.java +++ b/test-track/backend/src/main/java/io/metersphere/controller/IssuesController.java @@ -116,7 +116,7 @@ public class IssuesController { @GetMapping("/delete/{id}") @MsAuditLog(module = OperLogModule.TRACK_BUG, type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#id)", msClass = IssuesService.class) - @SendNotice(taskType = NoticeConstants.TaskType.DEFECT_TASK, target = "#targetClass.get(#id)", targetClass = IssuesService.class, event = NoticeConstants.Event.DELETE, subject = "缺陷通知") + @SendNotice(taskType = NoticeConstants.TaskType.DEFECT_TASK, target = "#targetClass.getIssue(#id)", targetClass = IssuesService.class, event = NoticeConstants.Event.DELETE, subject = "缺陷通知") public void delete(@PathVariable String id) { issuesService.delete(id); } diff --git a/test-track/backend/src/main/java/io/metersphere/service/IssuesService.java b/test-track/backend/src/main/java/io/metersphere/service/IssuesService.java index 7a339f7d13..9bfad0ecee 100644 --- a/test-track/backend/src/main/java/io/metersphere/service/IssuesService.java +++ b/test-track/backend/src/main/java/io/metersphere/service/IssuesService.java @@ -308,6 +308,9 @@ public class IssuesService { public IssuesWithBLOBs getIssue(String id) { IssuesDao issuesWithBLOBs = extIssuesMapper.selectByPrimaryKey(id); + if (issuesWithBLOBs == null) { + return null; + } IssuesRequest issuesRequest = new IssuesRequest(); Project project = baseProjectService.getProjectById(issuesWithBLOBs.getProjectId()); issuesRequest.setWorkspaceId(project.getWorkspaceId());