From: Matthias Clasen Date: Sun, 3 Apr 2022 19:53:34 +0000 (-0400) Subject: inspector: Avoid a crash X-Git-Tag: archive/raspbian/4.6.5+ds-1+rpi1~1^2~19^2~1^2~24 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=feb3d3b274b4426963567c28b842e8dbf68999dd;p=gtk4.git inspector: Avoid a crash Attribute lists can be NULL, it turns out. --- diff --git a/gtk/inspector/prop-editor.c b/gtk/inspector/prop-editor.c index db3d6f2c1b..05048f5472 100644 --- a/gtk/inspector/prop-editor.c +++ b/gtk/inspector/prop-editor.c @@ -405,7 +405,7 @@ attr_list_changed (GObject *object, GParamSpec *pspec, gpointer data) { GtkEntry *entry = GTK_ENTRY (data); GValue val = G_VALUE_INIT; - char *str; + char *str = NULL; const char *text; PangoAttrList *attrs; @@ -413,7 +413,8 @@ attr_list_changed (GObject *object, GParamSpec *pspec, gpointer data) get_property_value (object, pspec, &val); attrs = g_value_get_boxed (&val); - str = pango_attr_list_to_string (attrs); + if (attrs) + str = pango_attr_list_to_string (attrs); if (str == NULL) str = g_strdup (""); text = gtk_editable_get_text (GTK_EDITABLE (entry));