ModuleBase_WidgetValueFeature* aFeatureValue =
dynamic_cast<ModuleBase_WidgetValueFeature*>(theValue);
if (aFeatureValue) {
- setPoint(aFeatureValue->feature(), aFeatureValue->point());
- isDone = true;
+ boost::shared_ptr<GeomAPI_Pnt2d> aPnt = aFeatureValue->point();
+ FeaturePtr aFeature = aFeatureValue->feature();
+ if (aFeature && aPnt) {
+ setPoint(aFeature, aPnt);
+ isDone = true;
+ }
}
}
return isDone;
void PartSet_OperationFeatureCreate::onWidgetActivated(ModuleBase_ModelWidget* theWidget)
{
myActiveWidget = theWidget;
- if (myPreSelection.size() > 0) {
+ if ((myPreSelection.size() > 0) && myActiveWidget) {
const XGUI_ViewerPrs& aPrs = myPreSelection.front();
ModuleBase_WidgetValueFeature aValue;
aValue.setFeature(aPrs.feature());