mirror of
https://github.com/OPM/ResInsight.git
synced 2026-08-27 05:37:21 -05:00
#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:
+11
-9
@@ -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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user