Commit 452a3f1e authored by David Jarvie's avatar David Jarvie
Browse files

Fix possible null dereference (Coverity 1167310)

parent 98733067
......@@ -2970,22 +2970,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;
}
// Adjust sub-repetition values to fit the recurrence.
setRepetition(mRepetition);
clearRecur();
endChanges();
}
......
Markdown is supported
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