PHP warning

Attempt to read property "name" on null

/home4/madinain/public_html/protected/views/site/photos_product_page.php(18)

06 if ($cat == '')
07 {
08     $this->pageTitle = "Products";
09 }
10 else
11 {
12 
13     //$catAlias = ucwords(str_replace("-", " ", $cat));
14 
15 
16     $nowCat = ImageCategory::model()->findByAttributes(array("id" => $cat));
17 
18     $this->pageTitle = CHtml::decode($nowCat->name);
19 }
20 ?>    
21 
22 <?php $this->nowPage = "products.html";  ?>
23 
24 
25     <!--main_content dynamic part start-->
26 
27     <h1>Our <span>Products</span></h1>
28     <p>
29     <?php echo $this->renderPartial("site/products_list",array("cat"=>$cat)); ?>
30     </p>

Stack Trace

#4
+
 /home4/madinain/public_html/protected/controllers/SiteController.php(57): CController->render("site/photos_product_page", array("cat" => "36"))
52 
53 
54    
55      public function actionPhotos($cat='')
56     {
57     $this->render('site/photos_product_page',array('cat'=>$cat));
58     } 
59     
60     
61     
62     
#14
+
 /home4/madinain/public_html/index.php(36): CApplication->run()
31 // specify how many levels of call stack should be shown in each log message
32 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
33 
34 
35 require_once($yii);
36 Yii::createWebApplication($config)->run();
2024-03-29 11:32:13 Apache Yii Framework/1.1.13