From 2ffab50248f7a0f3e5063672daf65bf00b863b9e Mon Sep 17 00:00:00 2001 From: dantefromhell <90508808+dantefromhell@users.noreply.github.com> Date: Tue, 16 May 2023 15:07:50 +0000 Subject: [PATCH] Fix invite-by-link stack trace Fix issue #3 by returning early if the current user is a guest. --- Events.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Events.php b/Events.php index a6bf8b9..cad74c3 100644 --- a/Events.php +++ b/Events.php @@ -29,6 +29,7 @@ public static function onProfileSidebarInit($event) public static function onAfterInsertInvite($event) { try { + if ( Yii::$app->user->isGuest ) return; $identity = Yii::$app->user->getIdentity(); $sponsor = new Sponsor(); $sponsor->invited_email = strtolower(trim($event->sender->email));