mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
Propagator: Add assert against duplicate done() calls
This commit is contained in:
parent
53080f4836
commit
0acb8caa4a
@ -219,9 +219,12 @@ static void blacklistUpdate(SyncJournalDb *journal, SyncFileItem &item)
|
||||
|
||||
void PropagateItemJob::done(SyncFileItem::Status statusArg, const QString &errorString)
|
||||
{
|
||||
// Duplicate calls to done() are a logic error
|
||||
ENFORCE(_state != Finished);
|
||||
_state = Finished;
|
||||
|
||||
_item->_status = statusArg;
|
||||
|
||||
_state = Finished;
|
||||
if (_item->_isRestoration) {
|
||||
if (_item->_status == SyncFileItem::Success
|
||||
|| _item->_status == SyncFileItem::Conflict) {
|
||||
@ -838,7 +841,7 @@ void PropagatorCompositeJob::slotSubJobFinished(SyncFileItem::Status status)
|
||||
// Delete the job and remove it from our list of jobs.
|
||||
subJob->deleteLater();
|
||||
int i = _runningJobs.indexOf(subJob);
|
||||
ASSERT(i >= 0);
|
||||
ENFORCE(i >= 0); // should only happen if this function is called more than once
|
||||
_runningJobs.remove(i);
|
||||
|
||||
// Any sub job error will cause the whole composite to fail. This is important
|
||||
|
||||
Loading…
Reference in New Issue
Block a user