mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-14 01:12:11 -05:00
Added test to make data access more robust.
p4#: 20403
This commit is contained in:
1 parent
0ed6c97ee3
commit
dbeb61bd53
1 file changed
+4
@@ -60,6 +60,8 @@ double RigGridScalarDataAccess::cellScalar(size_t i, size_t j, size_t k) const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigGridScalarDataAccess::cellScalar(size_t cellIndex) const
|
||||
{
|
||||
if (m_resultValues->size() == 0 ) return HUGE_VAL;
|
||||
|
||||
size_t resultValueIndex = cellIndex;
|
||||
|
||||
if (m_useGlobalActiveIndex)
|
||||
@@ -68,6 +70,8 @@ double RigGridScalarDataAccess::cellScalar(size_t cellIndex) const
|
||||
if (resultValueIndex == cvf::UNDEFINED_SIZE_T) return HUGE_VAL;
|
||||
}
|
||||
|
||||
if (m_resultValues->size() <= resultValueIndex) return HUGE_VAL;
|
||||
|
||||
return m_resultValues->at(resultValueIndex);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user