diff options
author | link2xt <link2xt@testrun.org> | 2021-08-28 20:19:55 +0000 |
---|---|---|
committer | link2xt <link2xt@testrun.org> | 2021-08-28 20:19:55 +0000 |
commit | 27f7b38d719322dd60c38df98ee76c81961252ef (patch) | |
tree | 91b52e9e858059f0f39ebb29ebe5854f03c5c348 /accounts.cpp | |
parent | 1576c212a914b49234acde03fa62aca84bddc697 (diff) | |
download | kdeltachat-27f7b38d719322dd60c38df98ee76c81961252ef.tar.gz kdeltachat-27f7b38d719322dd60c38df98ee76c81961252ef.zip |
Return null from DcAccounts::getSelectedAccount if there are no accounts
Diffstat (limited to 'accounts.cpp')
-rw-r--r-- | accounts.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/accounts.cpp b/accounts.cpp index 8a71668..5ae7363 100644 --- a/accounts.cpp +++ b/accounts.cpp @@ -58,8 +58,11 @@ Context * DcAccounts::getSelectedAccount() { dc_context_t *context = dc_accounts_get_selected_account(m_accounts); - - return new Context(this, context); + if (context) { + return new Context(this, context); + } else { + return nullptr; + } } bool |