diff --git a/plugins/baser-core/src/Mailer/BcMailer.php b/plugins/baser-core/src/Mailer/BcMailer.php index 977b6d41c6..2714a56013 100644 --- a/plugins/baser-core/src/Mailer/BcMailer.php +++ b/plugins/baser-core/src/Mailer/BcMailer.php @@ -53,7 +53,7 @@ public function __construct($config = null) { parent::__construct($config); $request = Router::getRequest(); - $site = $request->getAttribute('currentSite'); + $site = $request ? $request->getAttribute('currentSite') : null; $this->setEmailTransport(); if ($site) $this->viewBuilder() ->setTheme($site->theme)