From 9c33adf118d10bbc39717b84847d92ce8be64944 Mon Sep 17 00:00:00 2001 From: John Ralls Date: Tue, 23 Apr 2019 11:39:17 -0700 Subject: [PATCH] Don't call g_object_ref on NULL, it whines. Fixes https://gitlab.gnome.org/GNOME/gtk/issues/1822 --- gdk/quartz/gdkevents-quartz.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gdk/quartz/gdkevents-quartz.c b/gdk/quartz/gdkevents-quartz.c index efb6961fa7..8e8f1ef183 100644 --- a/gdk/quartz/gdkevents-quartz.c +++ b/gdk/quartz/gdkevents-quartz.c @@ -613,7 +613,10 @@ find_toplevel_under_pointer (GdkDisplay *display, gint gdk_x = 0, gdk_y = 0; _gdk_quartz_window_nspoint_to_gdk_xy (screen_point, &gdk_x, &gdk_y); toplevel = _gdk_quartz_window_find_child (_gdk_root, gdk_x, gdk_y, TRUE); - info->toplevel_under_pointer = g_object_ref (toplevel); + if (toplevel) + info->toplevel_under_pointer = g_object_ref (toplevel); + else + info->toplevel_under_pointer = NULL; } if (toplevel) {