aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlink2xt <link2xt@testrun.org>2021-08-28 20:19:55 +0000
committerlink2xt <link2xt@testrun.org>2021-08-28 20:19:55 +0000
commit27f7b38d719322dd60c38df98ee76c81961252ef (patch)
tree91b52e9e858059f0f39ebb29ebe5854f03c5c348
parent1576c212a914b49234acde03fa62aca84bddc697 (diff)
downloadkdeltachat-27f7b38d719322dd60c38df98ee76c81961252ef.tar.gz
kdeltachat-27f7b38d719322dd60c38df98ee76c81961252ef.zip
Return null from DcAccounts::getSelectedAccount if there are no accounts
-rw-r--r--accounts.cpp7
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