summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2020-01-11 22:12:36 +0100
committerAndreas Kling <awesomekling@gmail.com>2020-01-11 22:12:36 +0100
commit75c5e9af56370a7ae02f0baa7ffae41b599dd80a (patch)
tree133fc3ad0ce1209536012a602927f68693430780 /Libraries
parentd2e49719c4d60ea8fe5c372a838845554e39972a (diff)
downloadserenity-75c5e9af56370a7ae02f0baa7ffae41b599dd80a.zip
LibGUI: Fix assertion failure in GItemView::mouse_up()
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibGUI/GItemView.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/Libraries/LibGUI/GItemView.cpp b/Libraries/LibGUI/GItemView.cpp
index 1d916fb8fe..389f9ead69 100644
--- a/Libraries/LibGUI/GItemView.cpp
+++ b/Libraries/LibGUI/GItemView.cpp
@@ -149,10 +149,12 @@ void GItemView::mouseup_event(GMouseEvent& event)
return;
}
int item_index = item_at_event_position(event.position());
- auto index = model()->index(item_index, m_model_column);
- if ((selection().size() > 1) & m_might_drag) {
- selection().set(index);
- m_might_drag = false;
+ if (item_index >= 0) {
+ auto index = model()->index(item_index, m_model_column);
+ if ((selection().size() > 1) & m_might_drag) {
+ selection().set(index);
+ m_might_drag = false;
+ }
}
GAbstractView::mouseup_event(event);
}