From e12d2f9a048b7a6074d5cfd10d757185d95e9a48 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 27 Jan 2022 19:28:25 +0100 Subject: [PATCH] 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. --- Userland/Libraries/LibGUI/FilteringProxyModel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibGUI/FilteringProxyModel.cpp b/Userland/Libraries/LibGUI/FilteringProxyModel.cpp index bb243b572c..75759b5d4b 100644 --- a/Userland/Libraries/LibGUI/FilteringProxyModel.cpp +++ b/Userland/Libraries/LibGUI/FilteringProxyModel.cpp @@ -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;