Wonjun Hong Wonjun Hong 2018-08-17
webhook: Fix webhook bug #371 (compensate the defect of ccac98c)
@6b4bc79fbff8806cce5d256fed9c989be117c5d9
app/models/Webhook.java
--- app/models/Webhook.java
+++ app/models/Webhook.java
@@ -352,10 +352,9 @@
     }
 
     private String buildJsonWithIssueEventDetails(Issue eventIssue, ArrayNode detailFields, ArrayNode attachments, String requestMessage) {
-        String title = Messages.get(Lang.defaultLang(), "issue.noMilestone");
-        if (eventIssue.milestone != null)
-            title = eventIssue.milestone.title;
-        detailFields.add(buildTitleValueJSON(Messages.get(Lang.defaultLang(), "notification.type.milestone.changed"), title, true));
+        if (eventIssue.milestone != null ) {
+            detailFields.add(buildTitleValueJSON(Messages.get(Lang.defaultLang(), "notification.type.milestone.changed"), eventIssue.milestone.title, true));
+        }
         detailFields.add(buildTitleValueJSON(Messages.get(Lang.defaultLang(), ""), eventIssue.assigneeName(), true));
         detailFields.add(buildTitleValueJSON(Messages.get(Lang.defaultLang(), "issue.state"), eventIssue.state.toString(), true));
         attachments.add(buildAttachmentJSON(eventIssue.body, detailFields));
Add a comment
List