From: vsv Date: Mon, 9 Jun 2014 12:37:33 +0000 (+0400) Subject: Check ShapePtr on validity X-Git-Tag: V_0.4.4~300 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=58d448919b915da97a7d378bac49fc8a977bd102;p=modules%2Fshaper.git Check ShapePtr on validity --- diff --git a/src/XGUI/XGUI_Displayer.cpp b/src/XGUI/XGUI_Displayer.cpp index e588367b8..ae0ff21bb 100644 --- a/src/XGUI/XGUI_Displayer.cpp +++ b/src/XGUI/XGUI_Displayer.cpp @@ -186,13 +186,14 @@ void XGUI_Displayer::redisplay(FeaturePtr theFeature, bool isUpdateViewer) if (!isVisible(aFeature)) return; - Handle(AIS_InteractiveObject) aAISObj = getAISObject(aFeature); boost::shared_ptr aShapePtr = aFeature->data()->shape(); + if (aShapePtr) { + Handle(AIS_InteractiveObject) aAISObj = getAISObject(aFeature); + Handle(AIS_Shape) aAISShape = Handle(AIS_Shape)::DownCast(aAISObj); + aAISShape->Set(aShapePtr->impl()); - Handle(AIS_Shape) aAISShape = Handle(AIS_Shape)::DownCast(aAISObj); - aAISShape->Set(aShapePtr->impl()); - - AISContext()->Redisplay(aAISShape); + AISContext()->Redisplay(aAISShape); + } } void XGUI_Displayer::activateInLocalContext(FeaturePtr theFeature,