StimPlanModel: avoid crashing on incomplete projects.

This commit is contained in:
Kristian Bendiksen
2022-10-19 11:22:49 +02:00
parent a695edc13a
commit f7a2acc3cf
6 changed files with 41 additions and 11 deletions

View File

@@ -824,7 +824,7 @@ RimAnnotationCollectionBase* RimStimPlanModel::annotationCollection()
//--------------------------------------------------------------------------------------------------
void RimStimPlanModel::updatePerforationInterval()
{
if ( m_thicknessDirectionWellPath )
if ( m_thicknessDirectionWellPath && wellPath() && wellPath()->wellPathGeometry() )
{
if ( !m_perforationInterval )
{
@@ -836,9 +836,6 @@ void RimStimPlanModel::updatePerforationInterval()
if ( m_fractureOrientation == FractureOrientation::ALONG_WELL_PATH )
{
// Adjust perforation interval for longitudinal fractures to correct TVD depth
CAF_ASSERT( wellPath() );
CAF_ASSERT( wellPath()->wellPathGeometry() );
cvf::Vec3d wellPathTangent = wellPath()->wellPathGeometry()->tangentAlongWellPath( m_MD() );
halfPerforationLength =
RigStimPlanModelTools::calculatePerforationLength( wellPathTangent, m_perforationLength() ) * 0.5;