Wed, 13 May 2026 23:17:23 +0200
simplify code
relates to #833 and issue #834
| src/main/kotlin/de/uapcore/lightpit/servlet/ProjectServlet.kt | file | annotate | diff | comparison | revisions |
--- a/src/main/kotlin/de/uapcore/lightpit/servlet/ProjectServlet.kt Wed May 13 23:15:51 2026 +0200 +++ b/src/main/kotlin/de/uapcore/lightpit/servlet/ProjectServlet.kt Wed May 13 23:17:23 2026 +0200 @@ -521,14 +521,14 @@ if (type != null) { http.request.setAttribute("autoRelate", autoRelate) // pick a useful category for the relation - if (type.first == RelationType.Tests && type.second) { - // tested by a Test - issue.category = IssueCategory.Test - } else if (type.first == RelationType.DefectOf && type.second) { - // defect of a Bug - issue.category = IssueCategory.Bug - } else if (type.first == RelationType.SubtaskOf && type.second) { - issue.category = IssueCategory.Task + if (type.second) { + if (type.first == RelationType.Tests) { + issue.category = IssueCategory.Test + } else if (type.first == RelationType.DefectOf) { + issue.category = IssueCategory.Bug + } else if (type.first == RelationType.SubtaskOf) { + issue.category = IssueCategory.Task + } } } }