PHP warning

Attempt to read property "parentId" on null

/mnt/HC_Volume_23321257/focusextranet/public_html/protected/controllers/Front_ListController.php(912)

900         $condition->compare( "businessCategoryId", $categoryId );
901         $condition->compare( "status", "active" );
902         $businessList = BusinessModel::model()->findAll( $condition );
903         if( $businessList )
904         {
905             foreach( $businessList as $business )
906             {
907                 $county = getCountyDetails( $business->countyId );
908                 $business->county = $county;
909             }
910         }
911 
912         $advertCategory = $businessCategory->parentId;
913         if( $businessCategory->parentId == 0 )
914         {
915             $advertCategory = $categoryId;
916             $categoryName  = $businessCategory->name;
917         }
918         else
919         {
920             $parentCategory = BusinessCategoryModel::model()->findByPk( $businessCategory->parentId );
921             $categoryName   = $parentCategory->name . " " . $businessCategory->name;
922         }
923 
924         $advertList = $this->getAdvertsForCategory( $advertCategory );

Stack Trace

#12
+
 /mnt/HC_Volume_23321257/focusextranet/public_html/catalogafaceri.ro/public_html/index.php(44): CApplication->run()
39 define( "LANGUAGE_PATH", BASE_PATH."protected/languages/" );
40 
41 date_default_timezone_set( "Europe/Bucharest" );
42 
43 require_once( $yii );
44 Yii::createWebApplication( $config )->run();
2024-03-19 05:31:57 Apache Yii Framework/1.1.10