From d1203ff9cfa30fd8b1251e4c6a5b0b1716cf0bc6 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 3 Jan 2018 20:41:34 +0100 Subject: Make sure the index is valid. It is unless the model is buggy. --- framework/src/domain/folderlistmodel.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'framework/src') diff --git a/framework/src/domain/folderlistmodel.cpp b/framework/src/domain/folderlistmodel.cpp index c25e8bd6..1065b4d4 100644 --- a/framework/src/domain/folderlistmodel.cpp +++ b/framework/src/domain/folderlistmodel.cpp @@ -157,7 +157,9 @@ bool FolderListModel::lessThan(const QModelIndex &left, const QModelIndex &right bool FolderListModel::acceptRow(int sourceRow, const QModelIndex &sourceParent) const { auto index = sourceModel()->index(sourceRow, 0, sourceParent); + Q_ASSERT(index.isValid()); const auto folder = index.data(Sink::Store::DomainObjectRole).value(); + Q_ASSERT(folder); const auto enabled = folder->getEnabled(); return enabled; } -- cgit v1.2.3