make sure there is an mailObject before you try to do anything else

This commit is contained in:
Klaus Leithoff 2009-11-27 15:02:35 +00:00
parent 2bff775ac5
commit 2f74808302
3 changed files with 11 additions and 6 deletions

View File

@ -2386,7 +2386,12 @@
function openConnection($_icServerID=0, $_adminConnection=false)
{
#if (!is_object($this->mailPreferences)) echo function_backtrace();
if (!is_object($this->mailPreferences))
{
error_log(__METHOD__." No Object for MailPreferences found.". function_backtrace());
$this->errorMessage .= lang('No valid data to create MailProfile!!');
return false;
}
if(!$this->icServer = $this->mailPreferences->getIncomingServer((int)$_icServerID)) {
$this->errorMessage .= lang('No active IMAP server found!!');
return false;

View File

@ -467,7 +467,7 @@ class felamimail_hooks
$file['Manage Folders'] = $GLOBALS['egw']->link('/index.php',array('menuaction'=>'felamimail.uipreferences.listFolder'));
}
$icServer = $preferences->getIncomingServer(0);
if (is_object($preferences)) $icServer = $preferences->getIncomingServer(0);
if(is_a($icServer, 'defaultimap')) {
if($icServer->enableSieve)
{
@ -496,7 +496,7 @@ class felamimail_hooks
}
}
$ogServer = $preferences->getOutgoingServer(0);
if (is_object($preferences)) $ogServer = $preferences->getOutgoingServer(0);
if(is_a($ogServer, 'defaultsmtp')) {
if($ogServer->editForwardingAddress)
{

View File

@ -456,9 +456,9 @@
$preferences =& $bopreferences->getPreferences();
$urlMailbox = urlencode($this->mailbox);
$imapServer =& $preferences->getIncomingServer(0);
if (is_object($preferences)) $imapServer =& $preferences->getIncomingServer(0);
#_debug_array($imapServer);
$activeIdentity =& $preferences->getIdentity(0);
if (is_object($preferences)) $activeIdentity =& $preferences->getIdentity(0);
#_debug_array($activeIdentity);
$maxMessages =& $GLOBALS['egw_info']['user']['preferences']['common']['maxmatchs'];
if (empty($maxMessages)) $maxMessages = 23; // this seems to be the number off messages that fit the height of the folder tree