[mutter/gnome-3-34] wayland/data-device: Guard against a potential crash



commit 12152c7edb308589d060aa781e9a0274be1cbd14
Author: Robert Mader <robert mader posteo de>
Date:   Fri Jan 31 00:39:57 2020 +0100

    wayland/data-device: Guard against a potential crash
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/1031
    
    (cherry picked from commit c27fc3537b3fb83d1551b72b2fc468567c79e6e0)

 src/wayland/meta-wayland-data-device.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/src/wayland/meta-wayland-data-device.c b/src/wayland/meta-wayland-data-device.c
index b286fb9ad..d23a186ce 100644
--- a/src/wayland/meta-wayland-data-device.c
+++ b/src/wayland/meta-wayland-data-device.c
@@ -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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]