return myResults;
}
-std::shared_ptr<ModelAPI_Result> ModelAPI_Feature::firstResult()
+std::shared_ptr<ModelAPI_Result> ModelAPI_Feature::firstResult() const
{
return myResults.empty() ? std::shared_ptr<ModelAPI_Result>() : *(myResults.begin());
}
while (!myResults.empty()) { // remove one by one with messages
std::shared_ptr<ModelAPI_Result> aRes = *(myResults.begin());
aRes->setDisabled(aRes, true); // to avoid activation of the Part result
- myResults.erase(myResults.begin());
+ if (!myResults.empty()) // disabling result may erase the list (on undo of Part, issue 665)
+ myResults.erase(myResults.begin());
}
ModelAPI_Object::erase();
}