summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibGUI/AbstractView.cpp2
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;
}