Thu, 22 Oct 2020 12:00:34 +0200
fixes creation of redirect link when commenting an issue
src/main/java/de/uapcore/lightpit/modules/ProjectsModule.java | file | annotate | diff | comparison | revisions |
--- a/src/main/java/de/uapcore/lightpit/modules/ProjectsModule.java Thu Oct 22 11:06:15 2020 +0200 +++ b/src/main/java/de/uapcore/lightpit/modules/ProjectsModule.java Thu Oct 22 12:00:34 2020 +0200 @@ -511,7 +511,11 @@ resp.sendError(HttpServletResponse.SC_FORBIDDEN, "Detected manipulated form."); return ResponseType.NONE; } - final var issue = new Issue(issueIdParam.get()); + final var issue = dao.getIssueDao().find(issueIdParam.get()); + if (issue == null) { + resp.sendError(HttpServletResponse.SC_NOT_FOUND); + return ResponseType.NONE; + } try { final var issueComment = new IssueComment(getParameter(req, Integer.class, "commentid").orElse(-1), issue); issueComment.setComment(getParameter(req, String.class, "comment").orElse(""));