handle the case that the compressed to logically cartesian array is NULL

This commit is contained in:
Andreas Lauser 2014-05-13 15:03:29 +02:00
parent cbb5910a93
commit 2545b423fc

View File

@ -62,7 +62,7 @@ namespace Opm
// instead of 0, we subtract 1.
pvtTableIdx.resize(numCompressed);
for (size_t cellIdx = 0; cellIdx < numCompressed; ++ cellIdx) {
size_t cartesianCellIdx = compressedToCartesianCellIdx[cellIdx];
size_t cartesianCellIdx = compressedToCartesianCellIdx?compressedToCartesianCellIdx[cellIdx]:cellIdx;
assert(cartesianCellIdx < pvtnumData.size());
pvtTableIdx[cellIdx] = pvtnumData[cartesianCellIdx] - 1;