mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-25 22:50:25 -05:00
RicPerforationCellFilterEvaluator: Guard against out-of-range global cell index
This commit is contained in:
1 parent
294ab9f277
commit
dad431edac
1 file changed
+6
+6
@@ -57,6 +57,12 @@ bool RicPerforationCellFilterEvaluator::includesGlobalCell( size_t globalCellInd
|
||||
|
||||
const RigMainGrid* mainGrid = m_eclipseCase->eclipseCaseData()->mainGrid();
|
||||
|
||||
if ( globalCellIndex >= mainGrid->totalCellCount() )
|
||||
{
|
||||
++m_rejectedCellCount;
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t localCellIndex = 0;
|
||||
const RigGridBase* localGrid = mainGrid->gridAndGridLocalIdxFromGlobalCellIdx( globalCellIndex, &localCellIndex );
|
||||
if ( !localGrid )
|
||||
|
||||
Reference in new issue
Block a user