#14172 Fix crash in 3D well target editor from null parent well geometry

Guard against a null wellPathGeometry() when configuring the 3D well target editor for the first target of a lateral. The parent well pointer can be non-null while its geometry is not yet available, which caused a null dereference when copying wellPathPoints().
This commit is contained in:
Magne Sjaastad
2026-06-10 09:19:28 +02:00
parent f7ccfcfff6
commit 6a5f19d5a0
@@ -125,17 +125,19 @@ void RicWellTarget3dEditor::configureAndUpdateUi( const QString& uiConfigName )
{
if ( auto parentWellPath = wellPath->wellPathTieIn()->parentWell() )
{
auto geo = parentWellPath->wellPathGeometry();
auto points = geo->wellPathPoints();
for ( auto& p : points )
if ( auto geo = parentWellPath->wellPathGeometry() )
{
p = dispXf->transformToDisplayCoord( p );
}
auto points = geo->wellPathPoints();
// For the first target of a lateral, use the coordinates from the parent well as snap-to locations for
// the 3D manipulator sphere
m_manipulator->setPolyline( points );
for ( auto& p : points )
{
p = dispXf->transformToDisplayCoord( p );
}
// For the first target of a lateral, use the coordinates from the parent well as snap-to locations
// for the 3D manipulator sphere
m_manipulator->setPolyline( points );
}
}
}
}