From d448e12cf4cc35c8ec57b4ea11af1ef510f262d1 Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Tue, 16 Jul 2024 10:30:10 +0200 Subject: [PATCH] inspector: Fix a crash gdk_wayland_color_get_color_manager() rightfully is not NULL-safe. Fixes: 2031ec1b57 ("inspector: Show the color management protocol") --- gtk/inspector/general.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gtk/inspector/general.c b/gtk/inspector/general.c index 38ed59a1b2..7c9f778e92 100644 --- a/gtk/inspector/general.c +++ b/gtk/inspector/general.c @@ -696,7 +696,8 @@ add_wayland_protocols (GdkDisplay *display, append_wayland_protocol_row (gen, (struct wl_proxy *)d->viewporter); append_wayland_protocol_row (gen, (struct wl_proxy *)d->presentation); append_wayland_protocol_row (gen, (struct wl_proxy *)d->single_pixel_buffer); - append_wayland_protocol_row (gen, gdk_wayland_color_get_color_manager (d->color)); + if (d->color) + append_wayland_protocol_row (gen, gdk_wayland_color_get_color_manager (d->color)); } } #endif