author | zautrix <zautrix> | 2005-03-15 12:34:42 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-15 12:34:42 (UTC) |
commit | 2a92f30dbb2a2bfcee223d949a1672060b76f6ab (patch) (side-by-side diff) | |
tree | 893e0cbbff72a9ec5af40925d2c38397bbf2177a /libkcal | |
parent | 93d18021da7aa07f055b800def773b31e54a98a9 (diff) | |
download | kdepimpi-2a92f30dbb2a2bfcee223d949a1672060b76f6ab.zip kdepimpi-2a92f30dbb2a2bfcee223d949a1672060b76f6ab.tar.gz kdepimpi-2a92f30dbb2a2bfcee223d949a1672060b76f6ab.tar.bz2 |
crash fix when removing sync info
-rw-r--r-- | libkcal/calendarlocal.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp index 0eba6a9..52c298b 100644 --- a/libkcal/calendarlocal.cpp +++ b/libkcal/calendarlocal.cpp @@ -229,33 +229,34 @@ void CalendarLocal::removeSyncInfo( QString syncProfile) Incidence *inc; for ( inc = all.first(); inc; inc = all.next() ) { inc->removeID( syncProfile ); } if ( syncProfile.isEmpty() ) { QPtrList<Event> el; Event *todo; for ( todo = mEventList.first(); todo; todo = mEventList.next() ) { if ( todo->uid().left( 15 ) == QString("last-syncEvent-") ) el.append( todo ); } for ( todo = el.first(); todo; todo = el.next() ) { deleteIncidence ( todo ); } } else { Event *lse = event( "last-syncEvent-"+ syncProfile); - deleteIncidence ( lse ); + if ( lse ) + deleteIncidence ( lse ); } } QPtrList<Event> CalendarLocal::getExternLastSyncEvents() { QPtrList<Event> el; Event *todo; for ( todo = mEventList.first(); todo; todo = mEventList.next() ) { if ( todo->uid().left( 15 ) == QString("last-syncEvent-") ) if ( todo->summary().left(3) == "E: " ) el.append( todo ); } return el; } Event *CalendarLocal::event( QString syncProf, QString id ) |