projects
/
gtk4.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a6e4789
)
inspector: Avoid a crash
author
Matthias Clasen
<mclasen@redhat.com>
Sun, 3 Apr 2022 19:53:34 +0000
(15:53 -0400)
committer
Matthias Clasen
<mclasen@redhat.com>
Sun, 3 Apr 2022 19:55:21 +0000
(15:55 -0400)
Attribute lists can be NULL, it turns out.
gtk/inspector/prop-editor.c
patch
|
blob
|
history
diff --git
a/gtk/inspector/prop-editor.c
b/gtk/inspector/prop-editor.c
index db3d6f2c1b20f25ff7461f8b84dccf562ea8b4ca..05048f5472883ebc9fcb64efebe0fc011ebf9743 100644
(file)
--- 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));