From 31b1dd169070f8be6e82e7888315e5d4d69c2464 Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Mon, 29 Jul 2024 11:20:00 +0200 Subject: [PATCH] ResetTimeSteps(): Check paymentOptionIndex for correct value. --- library/include/mobilisis/calculator_functions.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/include/mobilisis/calculator_functions.h b/library/include/mobilisis/calculator_functions.h index c592678..050e0c6 100644 --- a/library/include/mobilisis/calculator_functions.h +++ b/library/include/mobilisis/calculator_functions.h @@ -40,12 +40,12 @@ public: } void ResetTimeSteps(int paymentOptionIndex) { - if (m_timeSteps.size() > 0) { + if (m_timeSteps.size() > 0 && paymentOptionIndex < m_timeSteps.size()) { m_timeSteps[paymentOptionIndex].clear(); } } QList timeSteps(int paymentOptionIndex=0) const { - if (m_timeSteps.size() > 0) { + if (m_timeSteps.size() > 0 && paymentOptionIndex < m_timeSteps.size()) { return m_timeSteps[paymentOptionIndex]; } return QList();