summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Klapetek <mklapetek@kde.org>2016-02-11 03:34:38 (GMT)
committerAlexandr Akulich <akulichalexander@gmail.com>2016-09-21 13:05:33 (GMT)
commitf053d76283b1955c4f37bf8fb5ce571af5bb9d27 (patch)
tree34818d994b19726f157aa6a12610f8bb1ff2b637
parent1a0b7e2843e15beb543fda4d954e50417f4a7228 (diff)
[declarative] Guard the MessagesModel::data from out-of-bounds indexes
Reviewed-by: Alexandr Akulich <akulichalexander@gmail.com>
-rw-r--r--KTp/Declarative/messages-model.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/KTp/Declarative/messages-model.cpp b/KTp/Declarative/messages-model.cpp
index f0692d4..179228c 100644
--- a/KTp/Declarative/messages-model.cpp
+++ b/KTp/Declarative/messages-model.cpp
@@ -270,7 +270,7 @@ QVariant MessagesModel::data(const QModelIndex &index, int role) const
{
QVariant result;
- if (index.isValid()) {
+ if (index.isValid() && index.row() < rowCount(index.parent())) {
const MessagePrivate m = d->messages[index.row()];
switch (role) {