mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#11909 Add null pointer guards when detecting unit system
This commit is contained in:
parent
8da0690096
commit
065528ffba
@ -808,6 +808,8 @@ void RimWellPathCollection::sortWellsByName()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::AppEnum<RiaDefines::EclipseUnitSystem> RimWellPathCollection::findUnitSystemForWellPath( const RimWellPath* wellPath )
|
||||
{
|
||||
if ( !wellPath || !wellPath->wellPathGeometry() ) return RiaDefines::EclipseUnitSystem::UNITS_UNKNOWN;
|
||||
|
||||
RimProject* project = RimProject::current();
|
||||
if ( project->activeOilField()->analysisModels->cases.empty() )
|
||||
{
|
||||
@ -815,6 +817,11 @@ caf::AppEnum<RiaDefines::EclipseUnitSystem> RimWellPathCollection::findUnitSyste
|
||||
}
|
||||
|
||||
const RigEclipseCaseData* eclipseCaseData = project->activeOilField()->analysisModels->cases()[0]->eclipseCaseData();
|
||||
if ( !eclipseCaseData || !eclipseCaseData->mainGrid() )
|
||||
{
|
||||
return RiaDefines::EclipseUnitSystem::UNITS_UNKNOWN;
|
||||
}
|
||||
|
||||
cvf::BoundingBox caseBoundingBox = eclipseCaseData->mainGrid()->boundingBox();
|
||||
cvf::BoundingBox wellPathBoundingBox;
|
||||
for ( const auto& wellPathPoint : wellPath->wellPathGeometry()->wellPathPoints() )
|
||||
|
Loading…
Reference in New Issue
Block a user