wayland/data-device: Guard against a potential crash

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1031
This commit is contained in:
Robert Mader 2020-01-31 00:39:57 +01:00
parent 6cc748cce9
commit c27fc3537b

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;