mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#950 Guard null pointer access
This commit is contained in:
parent
8dda8df02c
commit
09be967ae7
@ -1728,7 +1728,11 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::calculateDerivedResult(in
|
|||||||
|
|
||||||
size_t i, j, k;
|
size_t i, j, k;
|
||||||
femPart->structGrid()->ijkFromCellIndex(elmIdx, &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)
|
for(int elmNodIdx = 0; elmNodIdx < elmNodeCount; ++elmNodIdx)
|
||||||
{
|
{
|
||||||
|
@ -265,7 +265,11 @@ void RimGeoMechPropertyFilter::computeResultValueRange()
|
|||||||
{
|
{
|
||||||
if (resultDefinition->hasCategoryResult())
|
if (resultDefinition->hasCategoryResult())
|
||||||
{
|
{
|
||||||
const std::vector<QString>& fnVector = resultDefinition->ownerCaseData()->femPartResults()->activeFormationNames()->formationNames();
|
std::vector<QString> fnVector;
|
||||||
|
if (resultDefinition->ownerCaseData()->femPartResults()->activeFormationNames())
|
||||||
|
{
|
||||||
|
fnVector = resultDefinition->ownerCaseData()->femPartResults()->activeFormationNames()->formationNames();
|
||||||
|
}
|
||||||
setCategoryNames(fnVector);
|
setCategoryNames(fnVector);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -429,7 +429,11 @@ void RimGeoMechView::updateLegends()
|
|||||||
|
|
||||||
if (cellResult()->hasCategoryResult())
|
if (cellResult()->hasCategoryResult())
|
||||||
{
|
{
|
||||||
const std::vector<QString>& fnVector = gmCase->femPartResults()->activeFormationNames()->formationNames();
|
std::vector<QString> fnVector;
|
||||||
|
if (gmCase->femPartResults()->activeFormationNames())
|
||||||
|
{
|
||||||
|
fnVector = gmCase->femPartResults()->activeFormationNames()->formationNames();
|
||||||
|
}
|
||||||
cellResult()->legendConfig->setNamedCategoriesInverse(fnVector);
|
cellResult()->legendConfig->setNamedCategoriesInverse(fnVector);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user