summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Klapetek <[email protected]>2016-03-15 20:14:12 -0400
committerAlexandr Akulich <[email protected]>2016-09-21 18:09:30 +0500
commita0492908262fe1ae1fa3d6e8e2cf7b9a229a3368 (patch)
tree314b76ec4b635252968f3cbfb120dbeeb1cf27f0
parentd58fd6386a4cfc19e14b371c4b0af1a7acf79a19 (diff)
[declarative] Return 0 unread messages if channel is null
Reviewed-by: Alexandr Akulich <[email protected]>
-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()