From: Matthias Clasen Date: Fri, 13 Dec 2019 19:46:00 +0000 (-0500) Subject: x11: Only update cursors if we have any X-Git-Tag: archive/raspbian/4.4.1+ds1-2+rpi1^2~18^2~20^2~527^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=bf2c29a36a979e3e09f3e54d96c33714ea23b162;p=gtk4.git x11: Only update cursors if we have any We were accessing an on-demand created hash table without checking if it had been created first. Fixes: https://gitlab.gnome.org/GNOME/gtk/issues/2308 --- diff --git a/gdk/x11/gdkcursor-x11.c b/gdk/x11/gdkcursor-x11.c index e0de28ed90..6f2682dc40 100644 --- a/gdk/x11/gdkcursor-x11.c +++ b/gdk/x11/gdkcursor-x11.c @@ -305,6 +305,9 @@ gdk_x11_display_set_cursor_theme (GdkDisplay *display, if (size > 0) XcursorSetDefaultSize (xdisplay, size); + if (GDK_X11_DISPLAY (display)->cursors == NULL) + return; + g_hash_table_iter_init (&iter, GDK_X11_DISPLAY (display)->cursors); while (g_hash_table_iter_next (&iter, &cursor, &xcursor)) {