Commit 1a0b7e28 authored by Martin Klapetek's avatar Martin Klapetek Committed by Alexander Akulich

[declarative] Guard against null stuff

Reviewed-by: Alexander Akulich's avatarAlexandr Akulich <akulichalexander@gmail.com>
parent 46e4a5b7
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment