Guard null pointer access

This commit is contained in:
Magne Sjaastad 2017-12-15 13:08:31 +01:00
parent 78be5b351e
commit 4a8d19c238

View File

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