summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Klapetek <[email protected]>2016-02-10 22:16:37 -0500
committerAlexandr Akulich <[email protected]>2016-09-21 18:05:33 +0500
commit1a0b7e2843e15beb543fda4d954e50417f4a7228 (patch)
tree6c67632745234bca585f0dc7fac2736abdeee721
parent46e4a5b716bf3a0d69dc8e9dc41d6fcbd5ff7911 (diff)
[declarative] Guard against null stuff
Reviewed-by: Alexandr Akulich <[email protected]>
-rw-r--r--KTp/Declarative/conversation.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/KTp/Declarative/conversation.cpp b/KTp/Declarative/conversation.cpp
index d162dd2..2742320 100644
--- a/KTp/Declarative/conversation.cpp
+++ b/KTp/Declarative/conversation.cpp
@@ -122,18 +122,22 @@ QString Conversation::title() const
if (d->isGroupChat) {
QString roomName = textChannel()->targetId();
return roomName.left(roomName.indexOf(QLatin1Char('@')));
- } else {
+ } else if (!d->targetContact.isNull()) {
return d->targetContact->alias();
}
+
+ return QString();
}
QIcon Conversation::presenceIcon() const
{
if (d->isGroupChat) {
return KTp::Presence(Tp::Presence::available()).icon();
- } else {
+ } else if (!d->targetContact.isNull()) {
return KTp::Presence(d->targetContact->presence()).icon();
}
+
+ return QIcon();
}
QIcon Conversation::avatar() const