Fix protection to avoid errors

This commit is contained in:
Laurent Destailleur
2018-01-14 18:55:55 +01:00
parent 3c3402bc60
commit cc5dcde9e1
2 changed files with 5 additions and 8 deletions

View File

@@ -5395,7 +5395,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob
$substitutionarray['__[AnyConstantKey]__']=$outputlangs->trans('ValueOfConstant');
$substitutionarray['__DOL_MAIN_URL_ROOT__']=DOL_MAIN_URL_ROOT;
}
if (empty($exclude) || ! in_array('mycompany', $exclude))
if ((empty($exclude) || ! in_array('mycompany', $exclude)) && is_object($mysoc))
{
$substitutionarray=array_merge($substitutionarray, array(
'__MYCOMPANY_NAME__' => $mysoc->name,