From 2ffa023cc8612f8239a6130a5f93bc9875a41f53 Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Sat, 7 Feb 2015 17:05:58 +0100 Subject: [PATCH 1/1] Replace assertion by condition While the condition should be always true, clang-analyzer still complained about it. So turn this into a condition instead. Worst case we'll just lose the item selection now. --- src/uisupport/flatproxymodel.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/uisupport/flatproxymodel.cpp b/src/uisupport/flatproxymodel.cpp index 80d14f2b..bd6dcd08 100644 --- a/src/uisupport/flatproxymodel.cpp +++ b/src/uisupport/flatproxymodel.cpp @@ -204,8 +204,9 @@ QItemSelection FlatProxyModel::mapSelectionToSource(const QItemSelection &proxyS row++; } - Q_ASSERT(topLeftItem && bottomRightItem); // there should be one range left. - sourceSelection << QItemSelectionRange(mapToSource(createIndex(topLeftItem->pos(), left, topLeftItem)), mapToSource(createIndex(bottomRightItem->pos(), right, bottomRightItem))); + if (topLeftItem && bottomRightItem) { // there should be one range left. + sourceSelection << QItemSelectionRange(mapToSource(createIndex(topLeftItem->pos(), left, topLeftItem)), mapToSource(createIndex(bottomRightItem->pos(), right, bottomRightItem))); + } } return sourceSelection; -- 2.20.1