From d8ceb2c68ae2941fc7dc678dd6fb2cef113c53cc Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 29 Aug 2021 09:28:53 +1000 Subject: [PATCH] Additional check when sending mails - ensure the to_user exists! --- app/Jobs/Mail/NinjaMailerJob.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Jobs/Mail/NinjaMailerJob.php b/app/Jobs/Mail/NinjaMailerJob.php index 0c3fd1928..057045531 100644 --- a/app/Jobs/Mail/NinjaMailerJob.php +++ b/app/Jobs/Mail/NinjaMailerJob.php @@ -224,7 +224,7 @@ class NinjaMailerJob implements ShouldQueue return true; /* On the hosted platform we set default contacts a @example.com email address - we shouldn't send emails to these types of addresses */ - if(Ninja::isHosted() && strpos($this->nmo->to_user->email, '@example.com') !== false) + if(Ninja::isHosted() && $this->nmo->to_user && strpos($this->nmo->to_user->email, '@example.com') !== false) return true; /* GMail users are uncapped */