File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -322,11 +322,17 @@ class Gui::DocumentObjectData {
322
322
if (newSet.find (child) == newSet.end ()) {
323
323
// this means old child removed
324
324
updated = true ;
325
- docItem->_ParentMap [child]. erase (obj );
325
+ auto mapIt = docItem->_ParentMap . find (child );
326
326
327
- auto childVp = docItem->getViewProvider (child);
328
- if (childVp && child->getDocument () == obj->getDocument ())
329
- childVp->setShowable (docItem->isObjectShowable (child));
327
+ // If 'child' is not part of the map then it has already been deleted
328
+ // in _slotDeleteObject.
329
+ if (mapIt != docItem->_ParentMap .end ()) {
330
+ docItem->_ParentMap [child].erase (obj);
331
+
332
+ auto childVp = docItem->getViewProvider (child);
333
+ if (childVp && child->getDocument () == obj->getDocument ())
334
+ childVp->setShowable (docItem->isObjectShowable (child));
335
+ }
330
336
}
331
337
}
332
338
// We still need to check the order of the children
You can’t perform that action at this time.
0 commit comments