Protect against crash in 3d view due to nullptr in linkwellpathfeature command check (#7876)

* Protected against crash in 3d view due to nullptr

* Code cleanup
This commit is contained in:
jonjenssen
2021-08-14 14:23:55 +02:00
committed by GitHub
parent 8dbb1d5ccd
commit 605af789c6

View File

@@ -74,10 +74,12 @@ bool RicLinkWellPathFeature::isCommandChecked()
{
if ( !wellPaths().empty() )
{
auto firstWell = dynamic_cast<RimModeledWellPath*>( wellPaths().front() );
if ( auto geoDef = firstWell->geometryDefinition() )
if ( auto firstWell = dynamic_cast<RimModeledWellPath*>( wellPaths().front() ) )
{
return geoDef->isReferencePointUpdatesLinked();
if ( auto geoDef = firstWell->geometryDefinition() )
{
return geoDef->isReferencePointUpdatesLinked();
}
}
}
return false;