#950 Guard null pointer access

This commit is contained in:
Magne Sjaastad
2016-11-04 10:09:33 +01:00
parent 8dda8df02c
commit 09be967ae7
3 changed files with 15 additions and 3 deletions

View File

@@ -1728,7 +1728,11 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::calculateDerivedResult(in
size_t i, j, k;
femPart->structGrid()->ijkFromCellIndex(elmIdx, &i, &j, &k);
int formNameIdx = activeFormNames->formationIndexFromKLayerIdx(k);
int formNameIdx = -1;
if (activeFormNames)
{
formNameIdx = activeFormNames->formationIndexFromKLayerIdx(k);
}
for(int elmNodIdx = 0; elmNodIdx < elmNodeCount; ++elmNodIdx)
{