From 076120de8d96e7a7209815b54db1d121ed385c3e Mon Sep 17 00:00:00 2001 From: xxq250 Date: Mon, 19 Jun 2023 15:39:45 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20job=E4=B8=ADissue=E4=B8=8D=E5=AD=98?= =?UTF-8?q?=E5=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/jobs/touch_webhook_job.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/jobs/touch_webhook_job.rb b/app/jobs/touch_webhook_job.rb index 0a8c03e9f..bd5bae343 100644 --- a/app/jobs/touch_webhook_job.rb +++ b/app/jobs/touch_webhook_job.rb @@ -6,6 +6,7 @@ class TouchWebhookJob < ApplicationJob when 'IssueCreate' issue_id, sender_id = args[0], args[1] issue = Issue.find_by_id issue_id + return if issue.nil? sender = User.find_by_id sender_id return if issue.nil? || sender.nil? issue.project.webhooks.each do |webhook| @@ -16,6 +17,7 @@ class TouchWebhookJob < ApplicationJob when 'IssueUpdate' issue_id, sender_id, changes = args[0], args[1], args[2] issue = Issue.find_by_id issue_id + return if issue.nil? sender = User.find_by_id sender_id return if issue.nil? || sender.nil? || !changes.is_a?(Hash) || changes.blank? issue.project.webhooks.each do |webhook| @@ -27,6 +29,7 @@ class TouchWebhookJob < ApplicationJob when 'IssueAssign' issue_id, sender_id, changes = args[0], args[1], args[2] issue = Issue.find_by_id issue_id + return if issue.nil? sender = User.find_by_id sender_id return if issue.nil? || sender.nil? issue.project.webhooks.each do |webhook| @@ -38,6 +41,7 @@ class TouchWebhookJob < ApplicationJob when 'IssueLabel' issue_id, sender_id, changes = args[0], args[1], args[2] issue = Issue.find_by_id issue_id + return if issue.nil? sender = User.find_by_id sender_id return if issue.nil? || sender.nil? issue.project.webhooks.each do |webhook| @@ -49,6 +53,7 @@ class TouchWebhookJob < ApplicationJob when 'IssueComment' issue_id, sender_id, comment_id, action_type, comment_json = args[0], args[1], args[2], args[3], args[4] issue = Issue.find_by_id issue_id + return if issue.nil? comment = issue.comment_journals.find_by_id comment_id sender = User.find_by_id sender_id return if issue.nil? || sender.nil? @@ -63,6 +68,7 @@ class TouchWebhookJob < ApplicationJob when 'PullRequestComment' issue_id, sender_id, comment_id, action_type, comment_json = args[0], args[1], args[2], args[3], args[4] issue = Issue.find_by_id(issue_id) + return if issue.nil? comment = issue.comment_journals.find_by_id comment_id sender = User.find_by_id sender_id pull = issue.try(:pull_request)