mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-31 13:48:25 +00:00
LibGUI: Return early if drag_data_type is null (#3919)
If the user tries to drag an item with a null drag data type from an AbstractView, return from the mouse event early.
This commit is contained in:
@@ -265,6 +265,10 @@ void AbstractView::mousemove_event(MouseEvent& event)
|
||||
auto hovered_index = index_at_event_position(event.position());
|
||||
set_hovered_index(hovered_index);
|
||||
|
||||
auto data_type = m_model->drag_data_type();
|
||||
if (data_type.is_null())
|
||||
return ScrollableWidget::mousemove_event(event);
|
||||
|
||||
if (!m_might_drag)
|
||||
return ScrollableWidget::mousemove_event(event);
|
||||
|
||||
@@ -280,7 +284,6 @@ void AbstractView::mousemove_event(MouseEvent& event)
|
||||
if (distance_travelled_squared <= drag_distance_threshold)
|
||||
return ScrollableWidget::mousemove_event(event);
|
||||
|
||||
auto data_type = m_model->drag_data_type();
|
||||
ASSERT(!data_type.is_null());
|
||||
|
||||
dbg() << "Initiate drag!";
|
||||
|
||||
Reference in New Issue
Block a user