Fix: init m_timeSteps-vector in case its size is 0: m_timeSteps.push_back(QList<int>()).

Detected during testing.
This commit is contained in:
Gerhard Hoffmann 2024-04-24 13:18:23 +02:00
parent ea0bcde413
commit 24ca857b6f

View File

@ -1833,6 +1833,8 @@ QList<int> Calculator::GetTimeSteps(Configuration *cfg, int paymentOptionIndex)
if (m_timeSteps.size() > paymentOptionIndex) { if (m_timeSteps.size() > paymentOptionIndex) {
//qCritical() << __PRETTY_FUNCTION__ << "timeSteps:" << m_timeSteps; //qCritical() << __PRETTY_FUNCTION__ << "timeSteps:" << m_timeSteps;
return m_timeSteps[paymentOptionIndex]; return m_timeSteps[paymentOptionIndex];
} else {
m_timeSteps.push_back(QList<int>());
} }
QDateTime start = QDateTime::currentDateTime(); QDateTime start = QDateTime::currentDateTime();