mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-14 09:22:13 -05:00
Guard null pointer access
This commit is contained in:
1 parent
78be5b351e
commit
4a8d19c238
1 file changed
+10
-2
@@ -110,8 +110,13 @@ double RimWellPathFracture::wellAzimuthAtFracturePosition() const
|
||||
this->firstAncestorOrThisOfType(wellPath);
|
||||
if (!wellPath) return cvf::UNDEFINED_DOUBLE;
|
||||
|
||||
double wellPathAzimuth = 0.0;
|
||||
|
||||
RigWellPath* wellPathGeometry = wellPath->wellPathGeometry();
|
||||
double wellPathAzimuth = wellPathGeometry->wellPathAzimuthAngle(fracturePosition());
|
||||
if (wellPathGeometry)
|
||||
{
|
||||
wellPathAzimuth = wellPathGeometry->wellPathAzimuthAngle(fracturePosition());
|
||||
}
|
||||
|
||||
if (wellPathAzimuth < 0) wellPathAzimuth += 360;
|
||||
|
||||
@@ -142,7 +147,10 @@ void RimWellPathFracture::updatePositionFromMeasuredDepth()
|
||||
if (!wellPath) return;
|
||||
|
||||
RigWellPath* wellPathGeometry = wellPath->wellPathGeometry();
|
||||
positionAlongWellpath = wellPathGeometry->interpolatedPointAlongWellPath(m_measuredDepth());
|
||||
if (wellPathGeometry)
|
||||
{
|
||||
positionAlongWellpath = wellPathGeometry->interpolatedPointAlongWellPath(m_measuredDepth());
|
||||
}
|
||||
|
||||
this->setAnchorPosition(positionAlongWellpath);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user