From 8592b9c46ca9b5ccd2b239e8e843aed107b3878b Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Fri, 11 May 2012 16:08:41 +0000 Subject: [PATCH] Return the default configuration when no specific account was initialized --- src/account.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/account.c b/src/account.c index 47d6afb..6945f4a 100644 --- a/src/account.c +++ b/src/account.c @@ -119,7 +119,10 @@ Account * account_new(Mailer * mailer, char const * type, char const * title, (void *)mailer, type, title, (void *)store); #endif if(type == NULL) + { + error_set_code(1, "%s", strerror(EINVAL)); return NULL; + } if((account = object_new(sizeof(*account))) == NULL) return NULL; memset(account, 0, sizeof(*account)); @@ -186,6 +189,8 @@ void account_delete(Account * account) /* account_get_config */ AccountConfig * account_get_config(Account * account) { + if(account->account == NULL) + return account->definition->config; return account->definition->get_config(account->account); }