PHP warning

Attempt to read property "id" on null

/home2/bhghgc/public_html/protected/controllers/HomeController.php(384)

372 
373 
374 
375 
376 
377 
378 
379 
380 
381     public function actioncategory($slug)
382         {
383     $details = Category::model()->findByAttributes(array('slug'=>$slug));
384         $alltopic = Category::model()->findAll(array('condition' => 'parent_id=' . $details->id , 'order'=>'id DESC'  ));
385         $this->ogtitlehere = $details->title ;
386         if(!empty($details->id )){
387         $allservices = Services::model()->findAll(array('condition' => 'category_id=' . $details->id   ));
388         }else{
389         $this->redirect(array('notfound') );
390         }
391  
392         $this->pageTitle = $details->slug ;
393         $this->ogimage = $details->image ;
394         $this->ogtitlehere = $details->title ;
395         $this->description = $details->description ;
396         $this->keywords = $details->meta ;

Stack Trace

#14
+
 /home2/bhghgc/public_html/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-04-18 11:11:18 Apache Yii Framework/1.1.14