From d2a0adfa16ab9657092ae7a6bf4e3f6377211935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hans-J=C3=BCrgen=20Tappe?= Date: Wed, 10 Nov 2010 18:01:15 +0000 Subject: [PATCH] Fix as discussed on the developer list: Check for the availability of mailpreferences before using them. --- felamimail/inc/class.bofelamimail.inc.php | 32 +++++++++++++---------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/felamimail/inc/class.bofelamimail.inc.php b/felamimail/inc/class.bofelamimail.inc.php index c01bea6aaa..9e4ae0ce83 100644 --- a/felamimail/inc/class.bofelamimail.inc.php +++ b/felamimail/inc/class.bofelamimail.inc.php @@ -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); + } } }