Janitor : Guard nullpointer access

This commit is contained in:
Magne Sjaastad 2021-06-30 12:37:57 +02:00
parent d79dcafe5a
commit 93b5c39387

View File

@ -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;
}