Fix crash when copying the intersection.

Updating of the default is handled later, so is not neccesary when doint initAfterRead after deserialization.
This commit is contained in:
Jacob Støren 2019-11-20 09:04:39 +01:00
parent dcb32c285f
commit 439071dddf

View File

@ -184,16 +184,20 @@ void RimIntersectionHandle::updateDefaultSeparateDataSource()
if ( m_separateDataSource() == nullptr )
{
RimGridView* view;
this->firstAncestorOrThisOfTypeAsserted( view );
this->firstAncestorOrThisOfType( view );
if ( view )
{
std::vector<RimIntersectionResultDefinition*> iResDefs =
view->separateIntersectionResultsCollection()->intersectionResultsDefinitions();
if ( iResDefs.size() )
{
m_separateDataSource = iResDefs[0];
}
}
}
}
//--------------------------------------------------------------------------------------------------
///
@ -203,6 +207,8 @@ cvf::ref<RivIntersectionHexGridInterface> RimIntersectionHandle::createHexGridIn
RimIntersectionResultDefinition* resDef = activeSeparateResultDefinition();
if ( resDef && resDef->activeCase() )
{
// Eclipse case
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>( resDef->activeCase() );
if ( eclipseCase && eclipseCase->eclipseCaseData() )
{
@ -212,6 +218,8 @@ cvf::ref<RivIntersectionHexGridInterface> RimIntersectionHandle::createHexGridIn
this->isInactiveCellsVisible() );
}
// Geomech case
RimGeoMechCase* geomCase = dynamic_cast<RimGeoMechCase*>( resDef->activeCase() );
if ( geomCase && geomCase->geoMechData() && geomCase->geoMechData()->femParts() )