PHP notice

Trying to get property 'description' of non-object

/home/raovobjd/muahangmy.com/protected/controllers/front/CategoryController.php(12)

01 <?php
02 
03 class CategoryController extends Controller {
04     public $layout = 'shop_page';
05 
06     public function actionIndex() {
07         if (!isset($_GET['category_id'])) throw new CHttpException(999, 'Invalid request');
08         $sort_type_cookie = Yii::app()->request->cookies['mhm_sort_type'];
09         $category = Category::model()->findByPk($_GET['category_id']);
10         $detect = Yii::app()->mobileDetect;
11         //region for SEO
12         if ($category->description != '') {
13             $seo_description = $category->description;
14         } else {
15             $seo_description = Yii::app()->params['meta_description'];
16         }
17         Yii::app()->clientScript->registerMetaTag($seo_description, 'description');
18 
19         if ($category->keywords != '') {
20             $seo_keyword = $category->keywords;
21 
22         } else {
23             $seo_keyword = Yii::app()->params['meta_keyword'];
24         }

Stack Trace

#7
+
 /home/raovobjd/muahangmy.com/protected/components/WebApplicationEndBehavior.php(24): CApplication->run()
19         // and raise it.
20         $this->onModuleCreate = array($this, 'changeModulePaths');
21         $this->onModuleCreate(new CEvent($this->owner));
22 
23         $this->configMailerComponent();
24         $this->owner->run(); // Run application.
25     }
26 
27     // This event should be raised when CWebApplication
28     // or CWebModule instances are being initialized.
29     public function onModuleCreate ($event) {
#9
+
 /home/raovobjd/muahangmy.com/index.php(13): CComponent->__call("runEnd", array("front"))
08 defined('YII_DEBUG') or define('YII_DEBUG', true);
09 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 3);
10 
11 require_once($yii);
12 $app = Yii::createWebApplication($config);
13 $app->runEnd('front');
2024-03-28 12:01:03 LiteSpeed Yii Framework/1.1.14