From ae80b5a309be69a47b438e2dc1e342735b5e22aa Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Tue, 11 Jun 2013 12:08:44 +0200 Subject: Fix error when there's no writeable addressbook source (#1489162) --- program/steps/mail/show.inc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'program/steps/mail/show.inc') diff --git a/program/steps/mail/show.inc b/program/steps/mail/show.inc index d8d4372f9..59f4d55e1 100644 --- a/program/steps/mail/show.inc +++ b/program/steps/mail/show.inc @@ -275,9 +275,13 @@ function rcmail_contact_exists($email) if ($email) { // @TODO: search in all address books? $CONTACTS = $RCMAIL->get_address_book(-1, true); - $existing = $CONTACTS->search('email', $email, true, false); - if ($existing->count) - return true; + + if (is_object($CONTACTS)) { + $existing = $CONTACTS->search('email', $email, true, false); + if ($existing->count) { + return true; + } + } } return false; -- cgit v1.2.3