Guard time step index

This commit is contained in:
Magne Sjaastad 2017-02-20 10:04:21 +01:00
parent b7aebbb392
commit a29f325125

View File

@ -140,9 +140,12 @@ std::vector<std::vector<double>> RigStimPlanFractureDefinition::getDataAtTimeInd
size_t resIndex = resultIndex(resultName, unit);
if (resIndex != cvf::UNDEFINED_SIZE_T)
{
if (timeStepIndex < stimPlanData[resIndex].parameterValues.size())
{
return stimPlanData[resIndex].parameterValues[timeStepIndex];
}
}
qDebug() << "ERROR: Requested parameter does not exists in stimPlan data";
std::vector<std::vector<double>> emptyVector;