mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-10 08:03:05 -06:00
#2067 NNC : Guard before accessing values
This commit is contained in:
parent
dbc401ef71
commit
6aaa8f7606
@ -169,7 +169,7 @@ void RivNNCGeometryGenerator::textureCoordinates(cvf::Vec2fArray* textureCoords,
|
||||
nncResultVals = m_nncData->generatedConnectionScalarResult(scalarResultIndex, nativeTimeStepIndex);
|
||||
}
|
||||
|
||||
if (!nncResultVals)
|
||||
if (!nncResultVals || nncResultVals->size() == 0)
|
||||
{
|
||||
textureCoords->setAll(cvf::Vec2f(0.0f, 1.0f));
|
||||
return;
|
||||
|
@ -340,7 +340,7 @@ QString RiuResultTextBuilder::nncResultText()
|
||||
RigNNCData* nncData = grid->nncData();
|
||||
CVF_ASSERT(nncData);
|
||||
|
||||
if (nncData)
|
||||
if (nncData && m_nncIndex < nncData->connections().size())
|
||||
{
|
||||
const RigConnection& conn = nncData->connections()[m_nncIndex];
|
||||
cvf::StructGridInterface::FaceEnum face(conn.m_c1Face);
|
||||
@ -362,7 +362,7 @@ QString RiuResultTextBuilder::nncResultText()
|
||||
nncValues = nncData->dynamicConnectionScalarResult(scalarResultIdx, nativeTimeStep);
|
||||
}
|
||||
}
|
||||
if (nncValues)
|
||||
if (nncValues && (m_nncIndex < nncValues->size()))
|
||||
{
|
||||
QString resultVar = m_reservoirView->currentFaultResultColors()->resultVariableUiName();
|
||||
double scalarValue = (*nncValues)[m_nncIndex];
|
||||
@ -585,7 +585,7 @@ QString RiuResultTextBuilder::nncDetails()
|
||||
RigNNCData* nncData = grid->nncData();
|
||||
CVF_ASSERT(nncData);
|
||||
|
||||
if (nncData)
|
||||
if (nncData && m_nncIndex < nncData->connections().size())
|
||||
{
|
||||
text += "-- NNC details --\n";
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user