summaryrefslogtreecommitdiff
path: root/program/steps/mail
diff options
context:
space:
mode:
Diffstat (limited to 'program/steps/mail')
-rw-r--r--program/steps/mail/addcontact.inc12
1 files changed, 10 insertions, 2 deletions
diff --git a/program/steps/mail/addcontact.inc b/program/steps/mail/addcontact.inc
index 0baf6cd63..57bc2a1c6 100644
--- a/program/steps/mail/addcontact.inc
+++ b/program/steps/mail/addcontact.inc
@@ -23,8 +23,16 @@
if (!$OUTPUT->ajax_call)
return;
-$done = false;
-$CONTACTS = $RCMAIL->get_address_book(null, true);
+$abook = $RCMAIL->config->get('default_addressbook');
+
+// Get configured addressbook
+$CONTACTS = $RCMAIL->get_address_book($abook, true);
+
+// Get first writeable addressbook if the configured doesn't exist
+// This can happen when user deleted the addressbook (e.g. Kolab folder)
+if ($abook !== null && !is_object($CONTACTS)) {
+ $CONTACTS = $RCMAIL->get_address_book(null, true);
+}
if (!empty($_POST['_address']) && is_object($CONTACTS))
{