Skip to content

Commit

Permalink
Better initialization validation.
Browse files Browse the repository at this point in the history
Signed-off-by: alex-z <[email protected]>
  • Loading branch information
allexzander committed Dec 7, 2023
1 parent 6526109 commit 42161e4
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/libsync/clientstatusreporting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,21 @@ ClientStatusReporting::ClientStatusReporting(Account *account)
_statusStrings[i] = statusString;
}

if (_statusStrings.size() < ClientStatusReportingStatus::Count) {
return;
}

_database = QSharedPointer<ClientStatusReportingDatabase>::create(account);
if (!_database->isInitialized()) {
return;
}

_reporter = std::make_unique<ClientStatusReportingNetwork>(account, _database);
if (!_reporter->isInitialized()) {
return;
}

_isInitialized = _database->isInitialized() && _reporter->isInitialized();
_isInitialized = true;
}

ClientStatusReporting::~ClientStatusReporting()
Expand Down

0 comments on commit 42161e4

Please sign in to comment.