mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1767 Guard for use of index out of bounds
This commit is contained in:
parent
0d57d3ec8d
commit
cfddaa98ca
@ -193,11 +193,15 @@ QString RimTimeStepFilter::filteredTimeStepsAsText() const
|
|||||||
|
|
||||||
QString formatString = RimTools::createTimeFormatStringFromDates(timeSteps);
|
QString formatString = RimTools::createTimeFormatStringFromDates(timeSteps);
|
||||||
|
|
||||||
for (auto index : m_selectedTimeStepIndices.v())
|
for (auto selectedIndex : m_selectedTimeStepIndices.v())
|
||||||
{
|
{
|
||||||
QString stepText = timeSteps[static_cast<size_t>(index)].toString(formatString);
|
size_t timeStepIndex = static_cast<size_t>(selectedIndex);
|
||||||
text += stepText;
|
|
||||||
text += "\n";
|
if (timeStepIndex < timeSteps.size())
|
||||||
|
{
|
||||||
|
text += timeSteps[timeStepIndex].toString(formatString);
|
||||||
|
text += "\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return text;
|
return text;
|
||||||
|
Loading…
Reference in New Issue
Block a user