[gtk/matthiasc/for-main: 1/2] inspector: Avoid a crash
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/for-main: 1/2] inspector: Avoid a crash
- Date: Sun, 3 Apr 2022 19:55:39 +0000 (UTC)
commit f48b894468a64e6bf55579e81460815ef3d4b268
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Apr 3 15:53:34 2022 -0400
inspector: Avoid a crash
Attribute lists can be NULL, it turns out.
gtk/inspector/prop-editor.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
---
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));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]