mirror of
https://github.com/OPM/ResInsight.git
synced 2026-08-27 05:37:21 -05:00
#13876 WellPathGeometry: Return default values instead of assert and crash
This commit is contained in:
@@ -344,6 +344,7 @@ std::expected<caf::PdmObjectHandle*, QString> RimcWellPath_extractWellPathProper
|
||||
std::vector<double> mdValues;
|
||||
|
||||
auto wellPathGeom = wellPath->wellPathGeometry();
|
||||
if ( !wellPathGeom ) return std::unexpected( QString( "Well path has no geometry" ) );
|
||||
|
||||
double mdStepSize = m_resamplingInterval();
|
||||
CAF_ASSERT( mdStepSize > 0.0 );
|
||||
|
||||
@@ -77,6 +77,9 @@ void RigWellPathGeometryExporter::computeWellPathDataForExport( const RigWellPat
|
||||
std::vector<double>& tvdValues,
|
||||
std::vector<double>& mdValues )
|
||||
{
|
||||
if ( wellPathGeom.measuredDepths().empty() ) return;
|
||||
if ( mdStepSize <= 0.0 ) return;
|
||||
|
||||
double currMd = wellPathGeom.measuredDepths().front() - mdStepSize;
|
||||
// Safety check to avoid "infinite" loop: max MD for a well path cannot be more than 100 km
|
||||
// This could happen in certain corner cases for "weird" input, causing massive memory usage
|
||||
|
||||
Reference in New Issue
Block a user