PHP notice

Trying to get property of non-object

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

384             'current'=>$current,
385             'items'=>$items
386         ));
387     }
388     public function actionNewsdetail(){
389         $this->isHome = 'news';
390         $id = $this->pa('id');
391         $news = WiNews::model()->findByPk($id);
392         if($news){
393             $news->view_count+=1;
394             $news->save();
395         }
396         $this->title = $news->title;
397         $this->keywords = $news->keywords;
398         $this->description = $news->description;
399         $this->render('newsdetail', array(
400             'news'=>$news
401         ));
402     }
403     
404     //案例
405     public function actionCase(){
406         $this->isHome = 'case';
407         $caseType = $this->pa('casetype', 0);
408         $caseArr = array('党政机关领域', '水电交通能源领域', '科教司法卫生医疗领域','国企央企领域','银行金融企业领域');

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-29 23:31:04 nginx/1.10.3 Yii Framework/1.1.19