korganizer: fixed SEGFAULT when deleting recurring TODOs.

This resolves bug 2335 and 2682.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit 4e2582d3eb)
r14.0.x
Michele Calgaro 6 years ago
parent fa7ffe05ea
commit f199c3d632
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -479,9 +479,11 @@ bool Calendar::deleteIncidence( Incidence *incidence )
IncidenceList il = incidence->childIncidences(); IncidenceList il = incidence->childIncidences();
IncidenceListIterator it; IncidenceListIterator it;
it = il.begin(); it = il.begin();
if (it != il.end()) {
parentIncidence = this->incidence(*it); parentIncidence = this->incidence(*it);
parentIncidence->deleteChildIncidence(incidence->uid()); parentIncidence->deleteChildIncidence(incidence->uid());
} }
}
else { else {
// Delete all children as well // Delete all children as well
IncidenceList il = incidence->childIncidences(); IncidenceList il = incidence->childIncidences();

Loading…
Cancel
Save