PHP notice

Trying to get property of non-object

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

170             'items'=>$items,
171             'cid'=>$cid,
172             'default1'=>$default1,
173             'default2'=>$default2,
174 //             'offices'=>$offices
175         ));
176     }
177     
178     public function actionPdetail(){ 
179         $this->isHome = 'product'; 
180         $pid = (int)$this->pa('pid',0); 
181         $product = WiProduct::model()->findByPk($pid);
182         $this->keywords = $product->keywords;
183         $this->description = $product->description;
184         $this->title=$product->title;
185         $this->bannerImg = $this->cf('WiBanner', '7', 'image');
186         if(!$product){
187             $this->redirect('home/plist');exit;
188         }
189         $this->render('pdetail',array(
190             'product'=>$product
191         ));
192     }
193     
194     

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 23:38:45 nginx/1.10.3 Yii Framework/1.1.19