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 )
|
caf::AppEnum<RiaDefines::EclipseUnitSystem> RimWellPathCollection::findUnitSystemForWellPath( const RimWellPath* wellPath )
|
||||||
{
|
{
|
||||||
|
if ( !wellPath || !wellPath->wellPathGeometry() ) return RiaDefines::EclipseUnitSystem::UNITS_UNKNOWN;
|
||||||
|
|
||||||
RimProject* project = RimProject::current();
|
RimProject* project = RimProject::current();
|
||||||
if ( project->activeOilField()->analysisModels->cases.empty() )
|
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();
|
const RigEclipseCaseData* eclipseCaseData = project->activeOilField()->analysisModels->cases()[0]->eclipseCaseData();
|
||||||
cvf::BoundingBox caseBoundingBox = eclipseCaseData->mainGrid()->boundingBox();
|
if ( !eclipseCaseData || !eclipseCaseData->mainGrid() )
|
||||||
cvf::BoundingBox wellPathBoundingBox;
|
{
|
||||||
|
return RiaDefines::EclipseUnitSystem::UNITS_UNKNOWN;
|
||||||
|
}
|
||||||
|
|
||||||
|
cvf::BoundingBox caseBoundingBox = eclipseCaseData->mainGrid()->boundingBox();
|
||||||
|
cvf::BoundingBox wellPathBoundingBox;
|
||||||
for ( const auto& wellPathPoint : wellPath->wellPathGeometry()->wellPathPoints() )
|
for ( const auto& wellPathPoint : wellPath->wellPathGeometry()->wellPathPoints() )
|
||||||
{
|
{
|
||||||
wellPathBoundingBox.add( wellPathPoint );
|
wellPathBoundingBox.add( wellPathPoint );
|
||||||
|
Loading…
Reference in New Issue
Block a user