Telepathy-Qt was not very happy when accountPath was an empty string: it crashed somewhere in Telepathy-Qt DBus handling code.
This simple check should avoid it.
Details
The crash was catched during work on T9595: [KAddressbook] Use KPeople model for contact list, see scratch repo and "testab" application there.
We weren't able to show info for non-KTp account. With this patch, it no longer crashes.
Diff Detail
- Repository
- R145 KDE Telepathy Common Internals
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Telepathy-Qt was not very happy when accountPath was an empty string: it crashed somewhere in Telepathy-Qt DBus handling code.
If that's the case would checking for an empty string be safer?
Fails to build on:
https://kci.pangea.pub/job/cosmic_unstable_ktp-common-internals/67/parsed_console/
with
17:06:28 /usr/home/jenkins/workspace/Applications/ktp-common-internals/kf5-qt5 FreeBSDQt5.11/kpeople/uiplugins/imdetailswidget.cpp:58:35: error: calling a private constructor of class 'QString'
17:06:28 if (!contactId.startsWith("ktp://")) {
17:06:28 ^
17:06:28 /usr/local/include/qt5/QtCore/qstring.h:829:5: note: declared private here
17:06:28 QString(const char *ch);
17:06:28 ^
Sorry for that! Of course it should be QStringLiteral("ktp://") instead. I've fixed it in master