#13876 WellPathGeometry: Return default values instead of assert and crash

This commit is contained in:
Magne Sjaastad committed 2026-04-16 16:43:36 +02:00
1 parent 791a58c9a7
commit c82ba05c1b
1 file changed
+2 -2
@@ -1291,11 +1291,11 @@ std::pair<double, cvf::Vec2i>
const RigActiveCellInfo* activeCellInfo = caseData->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL );
auto wellPathGeometry = wellPath->wellPathGeometry();
CVF_ASSERT( wellPathGeometry );
if ( !wellPathGeometry ) return std::make_pair( cvf::UNDEFINED_DOUBLE, cvf::Vec2i() );
const std::vector<cvf::Vec3d>& coords = wellPathGeometry->wellPathPoints();
const std::vector<double>& mds = wellPathGeometry->measuredDepths();
CVF_ASSERT( !coords.empty() && !mds.empty() );
if ( coords.empty() || mds.empty() ) return std::make_pair( cvf::UNDEFINED_DOUBLE, cvf::Vec2i() );
std::vector<WellPathCellIntersectionInfo> intersections =
RigWellPathIntersectionTools::findCellIntersectionInfosAlongPath( caseData, wellPath->name(), coords, mds );