From ccf76d45f21a85b5f9d244e8b0e2a0986b2d7491 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Fri, 27 Jul 2018 08:19:11 +0800 Subject: [PATCH] FIX: Missing variable outside of `begin` block. --- app/jobs/regular/emit_web_hook_event.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/jobs/regular/emit_web_hook_event.rb b/app/jobs/regular/emit_web_hook_event.rb index 742c3b7f2b3..5cd4010abcd 100644 --- a/app/jobs/regular/emit_web_hook_event.rb +++ b/app/jobs/regular/emit_web_hook_event.rb @@ -70,6 +70,7 @@ module Jobs body = build_web_hook_body(args, web_hook) web_hook_event = WebHookEvent.create!(web_hook_id: web_hook.id) + response = nil begin content_type = @@ -118,7 +119,7 @@ module Jobs web_hook_event.destroy! end - retry_web_hook if response.status != 200 + retry_web_hook if response&.status != 200 end def retry_web_hook