From 386c243bd10009ec3e138efa68cdfc9bba1baa96 Mon Sep 17 00:00:00 2001 From: mbs Date: Wed, 18 Dec 2024 11:55:56 +0000 Subject: [PATCH] fixed crash in constructAISObject The Prs3d_PointAspect pointer may be NULL. --- src/CurveCreator/CurveCreator_Curve.cxx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/CurveCreator/CurveCreator_Curve.cxx b/src/CurveCreator/CurveCreator_Curve.cxx index 856885bfb..7e37d23ee 100644 --- a/src/CurveCreator/CurveCreator_Curve.cxx +++ b/src/CurveCreator/CurveCreator_Curve.cxx @@ -1093,10 +1093,13 @@ void CurveCreator_Curve::constructAISObject() // myAISShape->SetColor( myCurveColor ); myAISShape->SetWidth( myLineWidth ); Handle(Prs3d_PointAspect) anAspect = myAISShape->Attributes()->PointAspect(); - anAspect->SetScale( 3.0 ); - anAspect->SetTypeOfMarker(Aspect_TOM_O_POINT); - anAspect->SetColor(myPointAspectColor); - myAISShape->Attributes()->SetPointAspect( anAspect ); + if (!anAspect.IsNull()) + { + anAspect->SetScale( 3.0 ); + anAspect->SetTypeOfMarker(Aspect_TOM_O_POINT); + anAspect->SetColor(myPointAspectColor); + myAISShape->Attributes()->SetPointAspect( anAspect ); + } } Handle(AIS_InteractiveObject) CurveCreator_Curve::getAISObject( const bool theNeedToBuild ) const