Don't crash if person gets removed
ClosedPublic

Authored by poboiko on Sep 28 2018, 12:39 PM.

Details

Summary

Currently, right after removing a person (which i.e. removes it from personIndex), we call personChanged.
Which itself tries to access personIndex with recently removed key, which creates a default (invalid) value with such key.
In the end we obtain inconsistent (invalid) index, which leads to crash.

Test Plan

I've noted the bug when was working on T9595: [KAddressbook] Use KPeople model for contact list, see scratch repo and "testab" application there.
It's sufficient to check/uncheck address books several times to crash it.
After applying this patch, it no longer crashes.

Diff Detail

Repository
R307 KPeople
Branch
person-remove (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 3284
Build 3302: arc lint + arc unit
poboiko created this revision.Sep 28 2018, 12:39 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptSep 28 2018, 12:39 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
poboiko requested review of this revision.Sep 28 2018, 12:39 PM
davidedmundson accepted this revision.Sep 28 2018, 2:25 PM
This revision is now accepted and ready to land.Sep 28 2018, 2:25 PM
apol accepted this revision.Sep 28 2018, 2:48 PM

Thanks!

poboiko closed this revision.Sep 28 2018, 4:01 PM