Commit 30279fb2 authored by David Jarvie's avatar David Jarvie
Browse files

Fix possible null dereference (Coverity 1167310)

parent d50b8a49
......@@ -2687,21 +2687,18 @@ void KAEvent::setRecurrence(const KARecurrence &recurrence)
void KAEventPrivate::setRecurrence(const KARecurrence &recurrence)
{
startChanges(); // prevent multiple trigger time evaluation here
delete mRecurrence;
if (recurrence.recurs()) {
delete mRecurrence;
mRecurrence = new KARecurrence(recurrence);
mRecurrence->setStartDateTime(mStartDateTime.effectiveKDateTime(), mStartDateTime.isDateOnly());
mTriggerChanged = true;
// Adjust sub-repetition values to fit the recurrence.
setRepetition(mRepetition);
} else {
if (mRecurrence) {
mTriggerChanged = true;
}
mRecurrence = 0;
clearRecur();
}
// Adjust sub-repetition values to fit the recurrence.
setRepetition(mRepetition);
endChanges();
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment