PHP Error

Trying to get property of non-object

/home/hoangminhuk/public_html/protected/controllers/SiteController.php(471)

459         if (!Yii::app()->session['lang'])
460         {
461             Languages::setLanguage();
462         }
463         else 
464         {
465             Yii::app()->language = Yii::app()->session['lang'];
466         }
467         
468         $arr = array();
469         $cat = Cat::model()->findByPk($id);
470         
471         $subcat = Cat::getCatByParent($cat->id);
472         $arr[] = $cat->id;
473         if (count($subcat) > 0)
474         {
475             foreach ($subcat as $row) {
476                 $arr[] = $row->id;
477             }
478             $current_cat = $cat;
479         }
480         else 
481         {
482             $current_cat = $cat->pareCat;
483         }

Stack Trace

#9
+
 /home/hoangminhuk/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-03-29 02:54:25 LiteSpeed Yii Framework/1.1.7