Janitor : Guard nullpointer access

This commit is contained in:
Magne Sjaastad committed 2021-06-30 14:50:28 +02:00
1 parent d79dcafe5a
commit 93b5c39387
1 file changed
+6 -2
@@ -81,7 +81,11 @@ RimWellPathGeometryDef* RicLinkWellPathFeature::wellPathGeometryDef()
auto wellPathSelectionItem = RiuWellPathSelectionItem::wellPathSelectionItem();
if ( wellPathSelectionItem && wellPathSelectionItem->m_wellpath )
{
auto modeledWellPath = dynamic_cast<RimModeledWellPath*>( wellPathSelectionItem->m_wellpath );
return modeledWellPath->geometryDefinition();
if ( auto modeledWellPath = dynamic_cast<RimModeledWellPath*>( wellPathSelectionItem->m_wellpath ) )
{
return modeledWellPath->geometryDefinition();
}
}
return nullptr;
}