From 3f04c1679b538707ab728f5ab530e464a5c5a8c5 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 29 Jan 2023 18:31:10 +1100 Subject: [PATCH] Return early if no subscription --- app/Jobs/Util/WebhookSingle.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Jobs/Util/WebhookSingle.php b/app/Jobs/Util/WebhookSingle.php index d05f703e04..faa0c4fc9c 100644 --- a/app/Jobs/Util/WebhookSingle.php +++ b/app/Jobs/Util/WebhookSingle.php @@ -74,12 +74,16 @@ class WebhookSingle implements ShouldQueue */ public function handle() { -nlog($this->attempts()); MultiDB::setDb($this->db); $subscription = Webhook::with('company')->find($this->subscription_id); + if(!$subscription){ + $this->fail(); + return; + } + $this->company = $subscription->company; $this->entity->refresh();