From 2325e8e9a354911bb7ed5a749f9f921429633633 Mon Sep 17 00:00:00 2001 From: Vicky Kurniawan Date: Thu, 2 Sep 2021 22:28:37 +0700 Subject: [PATCH] Jira's autolink should support issue links that contain a comment link in the URL (#773) * handling wh.notifications array is empty * fixing shouldNotReceiveNotification condition --- server/webhook.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/webhook.go b/server/webhook.go index da1a4b0e7..8cb40ac31 100644 --- a/server/webhook.go +++ b/server/webhook.go @@ -194,6 +194,10 @@ func (wh *webhook) getConnection(p *Plugin, instance Instance, notification webh } func (wh *webhook) CheckIssueWatchers(p *Plugin, instanceID types.ID) { + if len(wh.notifications) == 0 { + return + } + instance, err := p.instanceStore.LoadInstance(instanceID) if err != nil { // This isn't an internal server error. There's just no instance installed. @@ -228,7 +232,7 @@ func (wh *webhook) CheckIssueWatchers(p *Plugin, instanceID types.ID) { postType = notification.postType message = notification.message } - if !shouldNotReceiveNotification { + if shouldNotReceiveNotification { continue } whUserNotification := webhookUserNotification{