diff options
-rw-r--r-- | ui/qt/interface_sort_filter_model.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ui/qt/interface_sort_filter_model.cpp b/ui/qt/interface_sort_filter_model.cpp index e40329f5fc..73dde7b6a2 100644 --- a/ui/qt/interface_sort_filter_model.cpp +++ b/ui/qt/interface_sort_filter_model.cpp @@ -246,6 +246,9 @@ QModelIndex InterfaceSortFilterModel::mapToSource(const QModelIndex &proxyIndex) if ( ! proxyIndex.isValid() ) return QModelIndex(); + if ( ! sourceModel() ) + return QModelIndex(); + QModelIndex baseIndex = QSortFilterProxyModel::mapToSource(proxyIndex); QModelIndex newIndex = sourceModel()->index(baseIndex.row(), _columns.at(proxyIndex.column())); |