[telepathy] [Bug 359571] Plasma (and ktp-contact-list) crashed when I block new contact invitation on jabber (telepathy-gabble)
Lukáš Karas via KDE Bugzilla
bugzilla_noreply at kde.org
Tue Mar 29 06:55:55 BST 2016
https://bugs.kde.org/show_bug.cgi?id=359571
--- Comment #1 from Lukáš Karas <lukas.karas at centrum.cz> ---
I recompiled kpeople today and this bug still exists...
kpeople head: a72809761419457b803e13ab91c1a1950b5f9ac8
I created simple patch that avoids `metacontacts[personRow]` access when
`personRow` is < 0.
diff --git a/src/personsmodel.cpp b/src/personsmodel.cpp
index 0c9fa13..13bdb50 100644
--- a/src/personsmodel.cpp
+++ b/src/personsmodel.cpp
@@ -343,6 +343,11 @@ void PersonsModelPrivate::onContactRemoved(const QString
&contactUri)
int personRow = personIndex[personUri].row();
+ if(personRow < 0){
+ qDebug() << "personRow: " << personRow << ", contactUri: " <<
contactUri << ", personUri: " << personUri;
+ removePerson(personUri);
+ return;
+ }
MetaContact &mc = metacontacts[personRow];
int contactPosition = mc.contactUris().indexOf(contactUri);
q->beginRemoveRows(q->index(personRow, 0), contactPosition,
contactPosition);
Console output when I remove spam contact:
personRow: -1 , contactUri:
"ktp://gabble/jabber/ktp_2djabber_2dim_12?doofyntv6@swissjabber.org" ,
personUri:
"ktp://gabble/jabber/ktp_2djabber_2dim_12?doofyntv6@swissjabber.org"
It fixes these crashes but I don't know if this is correct place where it
should be fixed...
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the Kde-telepathy-bugs
mailing list