diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicLinkWellPathFeature.cpp b/ApplicationLibCode/Commands/WellPathCommands/RicLinkWellPathFeature.cpp index d956777868..ee89e4545c 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/RicLinkWellPathFeature.cpp +++ b/ApplicationLibCode/Commands/WellPathCommands/RicLinkWellPathFeature.cpp @@ -74,10 +74,12 @@ bool RicLinkWellPathFeature::isCommandChecked() { if ( !wellPaths().empty() ) { - auto firstWell = dynamic_cast( wellPaths().front() ); - if ( auto geoDef = firstWell->geometryDefinition() ) + if ( auto firstWell = dynamic_cast( wellPaths().front() ) ) { - return geoDef->isReferencePointUpdatesLinked(); + if ( auto geoDef = firstWell->geometryDefinition() ) + { + return geoDef->isReferencePointUpdatesLinked(); + } } } return false;