From 814dfdaa1bdefe01c9eb37de52997c198a77f22c Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Fri, 1 Jun 2018 08:59:47 +0200 Subject: Avoid trying to remove an item that we don't have in the model. This triggered the assert in createIndexFromId. --- common/modelresult.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/modelresult.cpp b/common/modelresult.cpp index 495eca0..57f5ce8 100644 --- a/common/modelresult.cpp +++ b/common/modelresult.cpp @@ -340,6 +340,9 @@ template void ModelResult::remove(const Ptr &value) { auto childId = qHash(*value); + if (!mEntities.contains(childId)) { + return; + } //The removed entity will have no properties, but we at least need the parent property. auto actualEntity = mEntities.value(childId); auto id = parentId(actualEntity); -- cgit v1.2.3