PHP notice

Trying to get property of non-object

/home/rcherz/web/protected/controllers/UsersController.php(104)

092 
093             // clear cache
094             $this->clearUrlFromVarnishCache($user->getPhotoUrl(true, 'small'));
095             $this->clearUrlFromVarnishCache($user->getPhotoUrl(true, 'medium'));
096             $this->clearUrlFromVarnishCache($user->getPhotoUrl(true, 'large'));
097 
098             Yii::app()->end();
099     
100     }
101 
102     private function setProfileMetaTags($user)
103     {
104         $this->setPageTitle($user->first_name . ' ' . $user->last_name);
105 
106         if (!empty($this->actionParams['shareMessage'])) {
107             $this->setDescription($this->actionParams['shareMessage']);
108         }
109         else {
110             $this->setOgDescriptionFromProfile($user);
111         }
112     }
113 
114     private function setOgDescriptionFromProfile(Users $user){
115 
116         $ogDescription = 'Profile : ';

Stack Trace

#0
+
 /home/rcherz/web/protected/controllers/UsersController.php(1436): UsersController->setProfileMetaTags(null)
1431             throw new CHttpException("Required user does not exists");
1432         }
1433         
1434         $user = Users::model()->with('publicProfileSettings')->findByPk($this->actionParams['id']);
1435         
1436         $this->setProfileMetaTags($user);
1437 
1438         if(!empty($user->photo_name)){
1439             $this->setOgImageUrl($user->getPhotoUrl(true, 'medium'));
1440         }
1441 
#1
+
 /home/rcherz/web/protected/controllers/UsersController.php(155): UsersController->publicProfile()
150             Yii::app()->end();
151         }
152         
153         // for not loged in users show public profile
154         if(Yii::app()->user->isGuest || Users::isVirtualUser($this->actionParams['id'])){
155             $this->publicProfile();
156         }
157         else{
158             $this->profile();
159         }
160     }
#4
+
 /home/rcherz/web/protected/components/Controller.php(322): CController->runAction(CInlineAction)
317             // user is online
318             $uid_Uid = Yii::app()->user->id;
319             if ($uid_Uid != null) {
320                 Users::setOnlineUser($uid_Uid);
321             }
322             parent::runAction($actionID);
323         }
324         catch (Exception $e) {
325 
326             // CHttpException is not failure, this is standard error handling practice.
327             if ($e instanceof CHttpException) {
2024-03-19 04:07:57 nginx/1.18.0 Yii Framework/1.1.15