diff options
author | Andreas Kling <kling@serenityos.org> | 2020-08-29 00:16:58 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-08-29 00:16:58 +0200 |
commit | 734035857ed84e04e6540c498f98f118aa23909f (patch) | |
tree | 2c8792851876f13eec89df1831dc8f58b37c0e4e /Libraries | |
parent | 64e448eef067862e90ff5763a47d6fcebd4ec213 (diff) | |
download | serenity-734035857ed84e04e6540c498f98f118aa23909f.zip |
LibGUI: Allow AbstractView::set_cursor(ModelIndex(), ...)
This should be a valid way to clear the cursor.
Diffstat (limited to 'Libraries')
-rw-r--r-- | Libraries/LibGUI/AbstractView.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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; } |