LibGUI: Fix assertion failure in GItemView::mouse_up()

This commit is contained in:
Andreas Kling 2020-01-11 22:12:36 +01:00
parent d2e49719c4
commit 75c5e9af56
Notes: sideshowbarker 2024-07-19 10:10:10 +09:00

View file

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