PHP notice

Trying to get property of non-object

/var/VHOSTS/netline/www/protected/models/Catalog.php(439)

427             }
428         } else
429             return null;
430         if (is_null($c))
431             return null;
432         return $c->template;
433     }
434 
435     public static function UPLEVEL($id,$vo=false) { 
436         $alls = static::CTREE('CATALOG');
437         $c = isset($alls['G' . $id]) ? $alls['G' . $id] : null;
438         if (!is_null($c)) {
439             while ($c->level > 1 && !is_null($c) ) {
440                 $c = isset($alls[$c->xparent]) ? $alls[$c->xparent] : null;
441                 if($c && ($vo && !intval($c->visible))){
442                     $c=null;
443                 }
444             }
445         } 
446         if (is_null($c))
447             return null;
448         return $c;
449     }
450 
451     public static function ListChildsIds($rid) {

Stack Trace

#0
+
 /var/VHOSTS/netline/www/protected/controllers/IndexController.php(723): Catalog::UPLEVEL("146", true)
718             throw new CHttpException(404);
719         if (!intval($catalog->visible)) {
720             throw new CHttpException(410); // если каталог блокирован - показать как удаленный
721         }
722 
723         $cat = Catalog::UPLEVEL($catalog->id, true);
724         if (!$cat || !intval($cat->visible)) {
725             throw new CHttpException(410); // если каталог блокирован - показать как удаленный
726         }
727         $template = Template::model()->findByPk($cat->template);
728         if (!$template) {
#10
+
 /var/VHOSTS/netline/www/ntlindex.php(12): CApplication->run()
07 defined('YII_DEBUG') or define('YII_DEBUG',true);
08 // specify how many levels of call stack should be shown in each log message
09 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
10 
11 require_once($yii);
12 Yii::createWebApplication($config)->run();
2024-03-28 16:50:00 Apache/2.4.29 (Ubuntu) Yii Framework/1.1.15