summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Klapetek <mklapetek@kde.org>2016-03-09 22:10:33 (GMT)
committerAlexandr Akulich <akulichalexander@gmail.com>2016-09-21 13:05:33 (GMT)
commit294e1b91813ae6862efb834a884d41cc11e6d95e (patch)
tree6a4d722d175ab909b4d6ca3fc49c032824733d2e
parent2f406bd139bf2f02a286d10998b8611f59aca2b6 (diff)
[declarative] Guard for empty channel
Reviewed-by: Alexandr Akulich <akulichalexander@gmail.com>
-rw-r--r--KTp/Declarative/messages-model.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/KTp/Declarative/messages-model.cpp b/KTp/Declarative/messages-model.cpp
index 179228c..6a002d9 100644
--- a/KTp/Declarative/messages-model.cpp
+++ b/KTp/Declarative/messages-model.cpp
@@ -364,6 +364,10 @@ int MessagesModel::unreadCount() const
void MessagesModel::acknowledgeAllMessages()
{
+ if (d->textChannel.isNull()) {
+ return;
+ }
+
QList<Tp::ReceivedMessage> queue = d->textChannel->messageQueue();
d->textChannel->acknowledge(queue);