Skip to content

Commit 2ad405c

Browse files
committed
LibGUI: Complain in SortingProxyModel::data() if map_to_target() fails
There is some sort of issue with using a SortingProxyModel together with ColumnsView. This is a workaround to allow FilePicker to use a MultiView for now, but this needs to be fixed separately somehow.
1 parent a5d7ea2 commit 2ad405c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Libraries/LibGUI/SortingProxyModel.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ Model::ColumnMetadata SortingProxyModel::column_metadata(int index) const
8181

8282
Variant SortingProxyModel::data(const ModelIndex& index, Role role) const
8383
{
84+
auto target_index = map_to_target(index);
85+
if (!target_index.is_valid()) {
86+
dbg() << "BUG! SortingProxyModel: Unable to convert " << index << " to target";
87+
return {};
88+
}
8489
return target().data(map_to_target(index), role);
8590
}
8691

0 commit comments

Comments
 (0)