PHP notice

Trying to get property of non-object

/opt/data2/wimuch_com_website/protected/controllers/HomeController.php(430)

418         ));
419     }
420     
421     
422     public function actionCasedetail(){ 
423         $this->isHome = 'case';
424         $id = $this->pa('id');
425         $news = WiCase::model()->findByPk($id);
426         if($news){
427             $news->view_count+=1;
428             $news->save();
429         }
430         $this->title = $news->title;
431         $this->keywords = $news->keywords;
432         $this->description = $news->description;
433         $this->render('casedetail', array(
434             'news'=>$news
435         ));
436     }
437 }

Stack Trace

#7
+
 /opt/data2/wimuch_com_website/index.php(13): CApplication->run()
08 defined('YII_DEBUG') or define('YII_DEBUG',true);
09 // specify how many levels of call stack should be shown in each log message
10 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
11 
12 require_once($yii);
13 Yii::createWebApplication($config)->run();
2024-03-28 17:19:36 nginx/1.10.3 Yii Framework/1.1.19