Error

Call to a member function getKMLPlacemark() on null

/kunden/93103_47249/webseiten/protected/controllers/LeuchtfeuerController.php(170)

158             $_model = Region::model()->findByPk($_GET['region']);
159             
160             if ($_model != null)
161             {
162                 $kml_string = $_model->getKMLString(isset($_GET['image']) ? $_GET['image'] : null);
163             }
164         } else if (isset($_GET['id']))
165         {
166             $_model = Leuchtfeuer::model()->findByPk($_GET['id']);
167             
168             $kml_string = '<?xml version="1.0" encoding="UTF-8"?>
169             <kml xmlns="http://www.opengis.net/kml/2.2">
170             <Document>'.$_model->getKMLPlacemark().'</Document></kml>';
171         }
172         
173         if ($kml_string != null)
174         {
175             header('Content-type: application/vnd.google-earth.kml+xml');
176             header('Content-Disposition: attachment; filename="leuchtfeuer.kml"');
177             
178             echo $kml_string;
179             exit();
180         }
181     }
182 

Stack Trace

#7
+
 /kunden/93103_47249/webseiten/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-19 05:07:33 Apache Yii Framework/1.1.21