From c8a537e180a4b54c56fbe577f256fdad197b0715 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Tue, 18 Jun 2013 12:55:49 +0200 Subject: [PATCH] Check for valid index before accessing data p4#: 21957 --- .../ReservoirDataModel/RigSingleWellResultsData.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ApplicationCode/ReservoirDataModel/RigSingleWellResultsData.cpp b/ApplicationCode/ReservoirDataModel/RigSingleWellResultsData.cpp index e32a5fcc29..609e2766ed 100644 --- a/ApplicationCode/ReservoirDataModel/RigSingleWellResultsData.cpp +++ b/ApplicationCode/ReservoirDataModel/RigSingleWellResultsData.cpp @@ -252,6 +252,11 @@ void RigSingleWellResultsData::computeStaticWellCellPath() for (bIt = staticWellBranches.begin(); bIt != staticWellBranches.end(); ++bIt) { + if (bIt->first >= m_wellCellsTimeSteps[0].m_wellResultBranches.size()) + { + continue; + } + // Copy from first time step RigWellResultBranch rigBranch = m_wellCellsTimeSteps[0].m_wellResultBranches[bIt->first]; rigBranch.m_branchIndex = bIt->first;