LibGUI: Allow AbstractView::set_cursor(ModelIndex(), ...)

This should be a valid way to clear the cursor.
This commit is contained in:
Andreas Kling 2020-08-29 00:16:58 +02:00
commit 734035857e
Notes: sideshowbarker 2024-07-19 03:03:23 +09:00

View file

@ -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;
}