PHP notice

Trying to get property of non-object

/mnt/storage/setnekretnine/protected/controllers/ObjectController.php(135)

123                 $color["strokeColor"] = 'rgb(0,51,255)';
124                 break;
125         }
126         
127         return $color;
128     }
129     
130     
131     public function actionBuilding($id)
132     {
133        
134         $building = Building::model()->with('floors.apartments_count','city','map_image')->findByPk($id);
135         $floors = $building->floors;
136         $polygons_array = array();
137         foreach($floors as $floor)
138         {
139             $temp_array = array();
140             $temp_array["polygon_id"] = "floor_".$floor->id;
141             $temp_array["clickable"] = true;
142             $temp_array["show"] = false;
143             $temp_array["drawable"] = false;
144             $temp_array["on_hover"] = true;
145             $temp_array["color"] = $this->setColor("");
146             $array_coordinates_string = explode(",", $floor->map_points);
147             $array_coordinates_number = array();

Stack Trace

#14
+
 /mnt/storage/setnekretnine/index.php(24): CApplication->run()
19 // specify how many levels of call stack should be shown in each log message
20 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
21 
22 require_once($yii);
23 
24 Yii::createWebApplication($config)->run();
25 
26 // Yii::app()->session['aaaa']=1;
27 // if (isset(Yii::app()->session['aaaa'])) Yii::app()->session['aaaa']=Yii::app()->session['aaaa']+1;
28 // else Yii::app()->session['aaaa']=1;
29 // echo Yii::app()->session['aaaa'];
2024-03-19 03:06:42 Apache/2.2.15 (CentOS) Yii Framework/1.1.14