mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-25 06:38:13 -05:00
#11909 Add null pointer guards when detecting unit system
This commit is contained in:
1 parent
8da0690096
commit
065528ffba
1 file changed
+9
-2
@@ -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,8 +817,13 @@ caf::AppEnum<RiaDefines::EclipseUnitSystem> RimWellPathCollection::findUnitSyste
|
||||
}
|
||||
|
||||
const RigEclipseCaseData* eclipseCaseData = project->activeOilField()->analysisModels->cases()[0]->eclipseCaseData();
|
||||
cvf::BoundingBox caseBoundingBox = eclipseCaseData->mainGrid()->boundingBox();
|
||||
cvf::BoundingBox wellPathBoundingBox;
|
||||
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() )
|
||||
{
|
||||
wellPathBoundingBox.add( wellPathPoint );
|
||||
|
||||
Reference in new issue
Block a user