Skip to content

Commit

Permalink
Fixed issue: PHP notice : Trying to get property of non-object if sur…
Browse files Browse the repository at this point in the history
…vey not exist
  • Loading branch information
Shnoulle committed Dec 14, 2012
1 parent abb62c5 commit 47319a4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions application/helpers/common_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -1409,7 +1409,7 @@ function getSurveyInfo($surveyid, $languagecode='')
$thissurvey=false;

// if no language code is set then get the base language one
if (!isset($languagecode) || $languagecode=='')
if ((!isset($languagecode) || $languagecode=='') && Survey::model()->findByPk($surveyid))
{
$languagecode=Survey::model()->findByPk($surveyid)->language;
}
Expand Down Expand Up @@ -7340,7 +7340,7 @@ function getHeader($meta = false)
{
$languagecode = Yii::app()->session['survey_'.$surveyid]['s_lang'];
}
elseif (isset($surveyid) && $surveyid)
elseif (isset($surveyid) && $surveyid && Survey::model()->findByPk($surveyid))
{
$languagecode=Survey::model()->findByPk($surveyid)->language;
}
Expand Down

0 comments on commit 47319a4

Please sign in to comment.