Additional check when sending mails - ensure the to_user exists!

This commit is contained in:
David Bomba 2021-08-29 09:28:53 +10:00
parent 7473f326c0
commit d8ceb2c68a

View File

@ -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 */