Return the default configuration when no specific account was initialized
This commit is contained in:
parent
80cd2bba68
commit
8592b9c46c
|
@ -119,7 +119,10 @@ Account * account_new(Mailer * mailer, char const * type, char const * title,
|
||||||
(void *)mailer, type, title, (void *)store);
|
(void *)mailer, type, title, (void *)store);
|
||||||
#endif
|
#endif
|
||||||
if(type == NULL)
|
if(type == NULL)
|
||||||
|
{
|
||||||
|
error_set_code(1, "%s", strerror(EINVAL));
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
if((account = object_new(sizeof(*account))) == NULL)
|
if((account = object_new(sizeof(*account))) == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
memset(account, 0, sizeof(*account));
|
memset(account, 0, sizeof(*account));
|
||||||
|
@ -186,6 +189,8 @@ void account_delete(Account * account)
|
||||||
/* account_get_config */
|
/* account_get_config */
|
||||||
AccountConfig * account_get_config(Account * account)
|
AccountConfig * account_get_config(Account * account)
|
||||||
{
|
{
|
||||||
|
if(account->account == NULL)
|
||||||
|
return account->definition->config;
|
||||||
return account->definition->get_config(account->account);
|
return account->definition->get_config(account->account);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user