summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Klapetek <mklapetek@kde.org>2016-03-16 00:14:12 (GMT)
committerAlexandr Akulich <akulichalexander@gmail.com>2016-09-21 13:09:30 (GMT)
commita0492908262fe1ae1fa3d6e8e2cf7b9a229a3368 (patch)
tree314b76ec4b635252968f3cbfb120dbeeb1cf27f0
parentd58fd6386a4cfc19e14b371c4b0af1a7acf79a19 (diff)
[declarative] Return 0 unread messages if channel is null
Reviewed-by: Alexandr Akulich <akulichalexander@gmail.com>
-rw-r--r--KTp/Declarative/messages-model.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/KTp/Declarative/messages-model.cpp b/KTp/Declarative/messages-model.cpp
index 6a002d9..0519b23 100644
--- a/KTp/Declarative/messages-model.cpp
+++ b/KTp/Declarative/messages-model.cpp
@@ -359,7 +359,11 @@ void MessagesModel::removeChannelSignals(const Tp::TextChannelPtr &channel)
int MessagesModel::unreadCount() const
{
- return d->textChannel->messageQueue().size();
+ if (d->textChannel) {
+ return d->textChannel->messageQueue().size();
+ }
+
+ return 0;
}
void MessagesModel::acknowledgeAllMessages()