Fix as discussed on the developer list:

Check for the availability of mailpreferences before using them.
This commit is contained in:
Hans-Jürgen Tappe 2010-11-10 18:01:15 +00:00
parent de818e86e3
commit d2a0adfa16

View File

@ -222,14 +222,16 @@
*/
function addAccount($_hookValues)
{
$icServer = $this->mailPreferences->getIncomingServer(0);
if(is_a($icServer,'defaultimap')) {
$icServer->addAccount($_hookValues);
}
if ($this->mailPreferences) {
$icServer = $this->mailPreferences->getIncomingServer(0);
if(is_a($icServer,'defaultimap')) {
$icServer->addAccount($_hookValues);
}
$ogServer = $this->mailPreferences->getOutgoingServer(0);
if(is_a($ogServer,'defaultsmtp')) {
$ogServer->addAccount($_hookValues);
$ogServer = $this->mailPreferences->getOutgoingServer(0);
if(is_a($ogServer,'defaultsmtp')) {
$ogServer->addAccount($_hookValues);
}
}
}
@ -524,14 +526,16 @@
function deleteAccount($_hookValues)
{
$icServer = $this->mailPreferences->getIncomingServer(0);
if(is_a($icServer,'defaultimap')) {
$icServer->deleteAccount($_hookValues);
}
if ($this->mailPreferences) {
$icServer = $this->mailPreferences->getIncomingServer(0);
if(is_a($icServer,'defaultimap')) {
$icServer->deleteAccount($_hookValues);
}
$ogServer = $this->mailPreferences->getOutgoingServer(0);
if(is_a($ogServer,'defaultsmtp')) {
$ogServer->deleteAccount($_hookValues);
$ogServer = $this->mailPreferences->getOutgoingServer(0);
if(is_a($ogServer,'defaultsmtp')) {
$ogServer->deleteAccount($_hookValues);
}
}
}