diff options
-rw-r--r-- | framework/src/accounts/accountfactory.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/framework/src/accounts/accountfactory.cpp b/framework/src/accounts/accountfactory.cpp index 9dbb402b..c7f3855b 100644 --- a/framework/src/accounts/accountfactory.cpp +++ b/framework/src/accounts/accountfactory.cpp | |||
@@ -43,11 +43,13 @@ QString AccountFactory::name() const | |||
43 | void AccountFactory::setAccountId(const QString &accountId) | 43 | void AccountFactory::setAccountId(const QString &accountId) |
44 | { | 44 | { |
45 | mAccountId = accountId; | 45 | mAccountId = accountId; |
46 | Sink::Store::fetchOne<Sink::ApplicationDomain::SinkAccount>(Sink::Query().filter(accountId.toUtf8())) | 46 | if (!accountId.isEmpty()) { |
47 | .then([this](const Sink::ApplicationDomain::SinkAccount &account) { | 47 | Sink::Store::fetchOne<Sink::ApplicationDomain::SinkAccount>(Sink::Query().filter(accountId.toUtf8())) |
48 | mAccountType = account.getProperty("type").toByteArray(); | 48 | .then([this](const Sink::ApplicationDomain::SinkAccount &account) { |
49 | loadPackage(); | 49 | mAccountType = account.getProperty("type").toByteArray(); |
50 | }).exec(); | 50 | loadPackage(); |
51 | }).exec(); | ||
52 | } | ||
51 | } | 53 | } |
52 | 54 | ||
53 | void AccountFactory::setAccountType(const QString &type) | 55 | void AccountFactory::setAccountType(const QString &type) |