From ce7c9ae13defe17f0966638d63d9f7f55806ac76 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Mon, 2 Jul 2018 14:33:21 +0200 Subject: Fixed yet another reduction update codepath --- common/datastorequery.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'common/datastorequery.cpp') diff --git a/common/datastorequery.cpp b/common/datastorequery.cpp index fd910f8..4c25710 100644 --- a/common/datastorequery.cpp +++ b/common/datastorequery.cpp @@ -361,10 +361,6 @@ public: auto oldSelectionResult = mSelectedValues.take(reductionValueBa); SinkTraceCtx(mDatastore->mLogCtx) << "Old selection result: " << oldSelectionResult << " New selection result: " << selectionResult.selection; - //If mSelectedValues did not containthe value, oldSelectionResult will be empty.(Happens if entites have been filtered) - if (oldSelectionResult.isEmpty()) { - return; - } if (oldSelectionResult == selectionResult.selection) { mSelectedValues.insert(reductionValueBa, selectionResult.selection); Q_ASSERT(!selectionResult.selection.isEmpty()); @@ -373,10 +369,12 @@ public: }); } else { //remove old result - Q_ASSERT(!oldSelectionResult.isEmpty()); - readEntity(oldSelectionResult, [&](const Sink::ApplicationDomain::ApplicationDomainType &entity, Sink::Operation) { - callback({entity, Sink::Operation_Removal}); - }); + //If mSelectedValues did not containthe value, oldSelectionResult will be empty.(Happens if entites have been filtered) + if (!oldSelectionResult.isEmpty()) { + readEntity(oldSelectionResult, [&](const Sink::ApplicationDomain::ApplicationDomainType &entity, Sink::Operation) { + callback({entity, Sink::Operation_Removal}); + }); + } //If the last item has been removed, then there's nothing to add if (!selectionResult.selection.isEmpty()) { -- cgit v1.2.3