#7671 StimPlan XML import: fix unit system assert on missing file.

This commit is contained in:
Kristian Bendiksen authored and Magne Sjaastad committed 2021-05-12 16:02:40 +02:00
1 parent 5f44c994bf
commit 9ad8b6ce69
1 file changed
+7 -2
@@ -308,7 +308,6 @@ void RimStimPlanFractureTemplate::loadDataAndUpdate()
}
else
{
setUnitSystem( RiaDefines::EclipseUnitSystem::UNITS_UNKNOWN );
m_readError = true;
}
@@ -818,7 +817,13 @@ void RimStimPlanFractureTemplate::convertToUnitSystem( RiaDefines::EclipseUnitSy
m_readError = false;
loadDataAndUpdate();
if ( m_stimPlanFractureDefinitionData.isNull() ) return;
if ( m_stimPlanFractureDefinitionData.isNull() )
{
m_readError = true;
// Force needed unit system when file reading fails to be able to open the project.
setUnitSystem( neededUnit );
return;
}
if ( neededUnit == RiaDefines::EclipseUnitSystem::UNITS_FIELD )
{