wayland/data-device: Guard against a potential crash

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1031

(cherry picked from commit c27fc3537b3fb83d1551b72b2fc468567c79e6e0)
This commit is contained in:
Robert Mader 2020-01-31 00:39:57 +01:00
parent de7782221a
commit 12152c7edb

View File

@ -1087,7 +1087,8 @@ drag_grab_button (MetaWaylandPointerGrab *grab,
}
else
{
meta_wayland_data_source_set_current_offer (source, NULL);
if (source)
meta_wayland_data_source_set_current_offer (source, NULL);
meta_wayland_data_device_set_dnd_source (&seat->data_device, NULL);
unset_selection_source (&seat->data_device, META_SELECTION_DND);
success= FALSE;