diff --git a/src/GEOMImpl/GEOMImpl_ShapeDriver.cxx b/src/GEOMImpl/GEOMImpl_ShapeDriver.cxx index 436e2a927..b7947fdf7 100644 --- a/src/GEOMImpl/GEOMImpl_ShapeDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_ShapeDriver.cxx @@ -1015,6 +1015,10 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(LOGBOOK& log) const aShape = anExtractor.GetResult(); + if (aShape.IsNull()) { + Standard_ConstructionError::Raise("Result of extraction is empty"); + } + // Get statistics. const TopTools_ListOfShape &aRemoved = anExtractor.GetRemoved(); const TopTools_ListOfShape &aModified = anExtractor.GetModified(); diff --git a/src/OperationGUI/OperationGUI_ExtractionDlg.cxx b/src/OperationGUI/OperationGUI_ExtractionDlg.cxx index 1e4c61142..0eee97dc7 100644 --- a/src/OperationGUI/OperationGUI_ExtractionDlg.cxx +++ b/src/OperationGUI/OperationGUI_ExtractionDlg.cxx @@ -1298,12 +1298,18 @@ void OperationGUI_ExtractionDlg::eraseSubShape(const int theId) void OperationGUI_ExtractionDlg::eraseAll() { TColStd_MapIteratorOfMapOfInteger anIter(myMapDisplayedIDs); + TColStd_ListOfInteger aDisplayedIDs; for (; anIter.More(); anIter.Next()) { - eraseSubShape(anIter.Key()); + aDisplayedIDs.Append(anIter.Key()); + } + + TColStd_ListIteratorOfListOfInteger aListIter(aDisplayedIDs); + + for (; aListIter.More(); aListIter.Next()) { + eraseSubShape(aListIter.Value()); } - myMapDisplayedIDs.Clear(); getDisplayer()->UpdateViewer(); }