summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2018-11-10 23:38:10 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2018-11-10 23:41:28 +0900
commitf199c3d632d866f3bb9e811c3969eb6f7c426e3b (patch)
tree6a308ca5922d09517fa52314a30e428608e46424
parentfa7ffe05ea0a57de4e06ad20e6df8204e4817e0a (diff)
downloadtdepim-f199c3d632d866f3bb9e811c3969eb6f7c426e3b.tar.gz
tdepim-f199c3d632d866f3bb9e811c3969eb6f7c426e3b.zip
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 4e2582d3ebe797a3054e33c6c5d7000395642f42)
-rw-r--r--libkcal/calendar.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/libkcal/calendar.cpp b/libkcal/calendar.cpp
index 5918a749b..f7988077a 100644
--- a/libkcal/calendar.cpp
+++ b/libkcal/calendar.cpp
@@ -479,8 +479,10 @@ bool Calendar::deleteIncidence( Incidence *incidence )
IncidenceList il = incidence->childIncidences();
IncidenceListIterator it;
it = il.begin();
- parentIncidence = this->incidence(*it);
- parentIncidence->deleteChildIncidence(incidence->uid());
+ if (it != il.end()) {
+ parentIncidence = this->incidence(*it);
+ parentIncidence->deleteChildIncidence(incidence->uid());
+ }
}
else {
// Delete all children as well