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));