From 734035857ed84e04e6540c498f98f118aa23909f Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 29 Aug 2020 00:16:58 +0200 Subject: [PATCH] LibGUI: Allow AbstractView::set_cursor(ModelIndex(), ...) This should be a valid way to clear the cursor. --- Libraries/LibGUI/AbstractView.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/LibGUI/AbstractView.cpp b/Libraries/LibGUI/AbstractView.cpp index db2146befd..80aa11fa10 100644 --- a/Libraries/LibGUI/AbstractView.cpp +++ b/Libraries/LibGUI/AbstractView.cpp @@ -428,7 +428,7 @@ void AbstractView::set_cursor(ModelIndex index, SelectionUpdate selection_update if (m_cursor_index == index) return; - if (!model()) { + if (!model() || !index.is_valid()) { m_cursor_index = {}; return; }