Made cell visibility check more robust

This commit is contained in:
Magne Sjaastad 2015-09-15 12:15:34 +02:00
parent 2b068676c5
commit 7c8fe47683

View File

@ -197,7 +197,9 @@ bool RimEclipseWell::calculateWellPipeVisibility(size_t frameIndex)
if (gridIndex != cvf::UNDEFINED_SIZE_T && gridCellIndex != cvf::UNDEFINED_SIZE_T)
{
cvf::cref<cvf::UByteArray> cellVisibility = rvMan->cellVisibility(visGridParts[gpIdx], gridIndex, frameIndex);
if ((*cellVisibility)[gridCellIndex])
if ((*cellVisibility).size() > 0 &&
(*cellVisibility).size() - 1 < gridCellIndex &&
(*cellVisibility)[gridCellIndex])
{
return true;
}