summaryrefslogtreecommitdiffstats
path: root/kmymoney2/views/khomeview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kmymoney2/views/khomeview.cpp')
-rw-r--r--kmymoney2/views/khomeview.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/kmymoney2/views/khomeview.cpp b/kmymoney2/views/khomeview.cpp
index 60bb173..8745d64 100644
--- a/kmymoney2/views/khomeview.cpp
+++ b/kmymoney2/views/khomeview.cpp
@@ -595,6 +595,13 @@ void KHomeView::showPayments(void)
schedule.remove(it);
continue;
}
+
+ //if nextPayment returns an invalid date, setNextDueDate will just skip it, resulting in a loop
+ //we check the resulting date and erase the schedule if invalid
+ if(!((*it).nextPayment((*it).nextDueDate())).isValid()) {
+ schedule.remove(it);
+ continue;
+ }
(*it).setNextDueDate((*it).nextPayment((*it).nextDueDate()));
qBubbleSort(schedule);