From 892cdf5775c12ee6cb3b457ab7c869ec2f75744f Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Thu, 5 Dec 2013 09:08:14 +0000 Subject: [PATCH] catch errors if there is NO configured account at all --- mail/inc/class.mail_bo.inc.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mail/inc/class.mail_bo.inc.php b/mail/inc/class.mail_bo.inc.php index f04288b781..cd4ccc3358 100644 --- a/mail/inc/class.mail_bo.inc.php +++ b/mail/inc/class.mail_bo.inc.php @@ -206,7 +206,7 @@ class mail_bo egw_cache::setSession('mail','activeProfileID',$_profileID); } //error_log(__METHOD__.__LINE__.' RestoreSession:'.$_restoreSession.' ProfileId:'.$_profileID.' called from:'.function_backtrace()); - if (!isset(self::$instances[$_profileID]) || $_restoreSession===false) + if ($_profileID && (!isset(self::$instances[$_profileID]) || $_restoreSession===false)) { self::$instances[$_profileID] = new mail_bo('utf-8',$_restoreSession,$_profileID); } @@ -225,8 +225,11 @@ class mail_bo $newprofileID = emailadmin_bo::getUserDefaultAccID(); // try loading the default profile for the user error_log(__METHOD__.__LINE__." Loading the Profile for ProfileID ".$_profileID.' failed for icServer; '.$e->getMessage().' Trigger new instance for Default-Profile '.$newprofileID.'. called from:'.function_backtrace()); - self::$instances[$newprofileID] = new mail_bo('utf-8',false,$newprofileID); - $_profileID = $newprofileID; + if ($newprofileID) + { + self::$instances[$newprofileID] = new mail_bo('utf-8',false,$newprofileID); + $_profileID = $newprofileID; + } } } self::$instances[$_profileID]->profileID = $_profileID;