diff options
author | Andreas Kling <awesomekling@gmail.com> | 2020-01-11 22:12:36 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2020-01-11 22:12:36 +0100 |
commit | 75c5e9af56370a7ae02f0baa7ffae41b599dd80a (patch) | |
tree | 133fc3ad0ce1209536012a602927f68693430780 /Libraries | |
parent | d2e49719c4d60ea8fe5c372a838845554e39972a (diff) | |
download | serenity-75c5e9af56370a7ae02f0baa7ffae41b599dd80a.zip |
LibGUI: Fix assertion failure in GItemView::mouse_up()
Diffstat (limited to 'Libraries')
-rw-r--r-- | Libraries/LibGUI/GItemView.cpp | 10 |
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); } |