Error

Call to a member function getRelated() on null

/home/suryapravaco/public_html/protected/modules/epaper/controllers/DefaultController.php(730)

718          
719     
720    public function actionMap(){
721         $config = ModuleLoader::getConfig("epaper");
722         $uploadDir = Yii::app()->params["uploadDir"];
723         $mediaDir = $config["mediaDir"];
724         $baseUrl = Yii::app()->getBaseUrl(true);
725         $id = Yii::app()->request->getParam("id");
726         $alias = Yii::app()->request->getParam("alias");    
727         $this->layout = "//layouts/blank_template";  
728         
729         $mapModel = EpaperMap::model()->findByPk($id);
730         $pageModel =  $mapModel->getRelated("rPage");        
731         $editionModel = $pageModel->getRelated("rEdition");
732         
733         //Check if map is present or not        
734         if(is_null($mapModel)){
735             throw new CHttpException(404,"Page not found");
736         } else {
737             if($alias != $mapModel->mp_alias){                
738                 $this->redirect($this->createUrl("//epaper/default/map",array("id"=>$mapModel->mp_id,"alias"=>$mapModel->mp_alias)),true,301);                
739             }
740         }
741         
742         //Check if respective edition is private or public

Stack Trace

#10
+
 /home/suryapravaco/public_html/index.php(14): CApplication->run()
09 defined('YII_DEBUG') or define('YII_DEBUG',true);
10 // specify how many levels of call stack should be shown in each log message
11 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
12 
13 require_once($yii);
14 Yii::createWebApplication($config)->run();
15 
16  
2024-03-29 04:02:40 Apache Yii Framework/1.1.19