1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:57:35 +00:00

LibGUI: Fix bogus root index column_count() in FilteringProxyModel

The root index (ModelIndex()) should should have the same column count
as the root index in the underlying model.
This commit is contained in:
Andreas Kling 2022-01-27 19:28:25 +01:00
parent 9ec826144f
commit e12d2f9a04

View file

@ -25,7 +25,7 @@ int FilteringProxyModel::row_count(ModelIndex const&) const
int FilteringProxyModel::column_count(ModelIndex const& index) const
{
if (!index.is_valid())
return {};
return m_model->column_count({});
if ((size_t)index.row() > m_matching_indices.size() || index.row() < 0)
return 0;